FileChannel.Open Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Open(IPath, IOpenOption[]) |
Opens or creates a file, returning a file channel to access the file. |
| Open(IPath, ICollection<IOpenOption>, IFileAttribute[]) |
Opens or creates a file, returning a file channel to access the file. |
Open(IPath, IOpenOption[])
Opens or creates a file, returning a file channel to access the file.
[Android.Runtime.Register("open", "(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/nio/channels/FileChannel;", "", ApiSince=26)]
public static Java.Nio.Channels.FileChannel? Open(Java.Nio.FileNio.IPath? path, params Java.Nio.FileNio.IOpenOption[]? options);
[<Android.Runtime.Register("open", "(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/nio/channels/FileChannel;", "", ApiSince=26)>]
static member Open : Java.Nio.FileNio.IPath * Java.Nio.FileNio.IOpenOption[] -> Java.Nio.Channels.FileChannel
Parameters
- path
- IPath
The path of the file to open or create
- options
- IOpenOption[]
Options specifying how the file is opened
Returns
A new file channel
- Attributes
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
Open(IPath, ICollection<IOpenOption>, IFileAttribute[])
Opens or creates a file, returning a file channel to access the file.
[Android.Runtime.Register("open", "(Ljava/nio/file/Path;Ljava/util/Set;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/channels/FileChannel;", "", ApiSince=26)]
public static Java.Nio.Channels.FileChannel? Open(Java.Nio.FileNio.IPath? path, System.Collections.Generic.ICollection<Java.Nio.FileNio.IOpenOption>? options, params Java.Nio.FileNio.Attributes.IFileAttribute[]? attrs);
[<Android.Runtime.Register("open", "(Ljava/nio/file/Path;Ljava/util/Set;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/channels/FileChannel;", "", ApiSince=26)>]
static member Open : Java.Nio.FileNio.IPath * System.Collections.Generic.ICollection<Java.Nio.FileNio.IOpenOption> * Java.Nio.FileNio.Attributes.IFileAttribute[] -> Java.Nio.Channels.FileChannel
Parameters
- path
- IPath
The path of the file to open or create
- options
- ICollection<IOpenOption>
Options specifying how the file is opened
- attrs
- IFileAttribute[]
An optional list of file attributes to set atomically when creating the file
Returns
A new file channel
- Attributes
Exceptions
If the set contains an invalid combination of options
If the path is associated with a provider that does not support creating file channels, or an unsupported open option is specified, or the array contains an attribute that cannot be set atomically when creating the file
If an I/O error occurs
If a security manager is installed and it denies an unspecified permission required by the implementation. In the case of the default provider, the checkRead method is invoked to check read access if the file is opened for reading. The checkWrite method is invoked to check write access if the file is opened for writing
Remarks
Java reference for java.nio.channels.FileChannel.open.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.