Warning: This section describes the
File is non-standard, not generally compiled into distributions, is a potential source of huge security holes, and not well tested.
Opens the file, specifying file mode and type.
- A comma-delimited list describing the method to use to open the file, described in detail here.
- A string describing the type of file being opened.
This method opens the file, preparing its resources for use by subsequent methods to examine or modify the file. Certain methods of
File, such as
write should not be used when the file is not open. Other methods, such as
remove may not be used when the file is open.
Valid file types are text, binary and unicode. Text indicates ASCII text without NUL characters. Binary indicates UTF-8 files. Unicode indicates UCS-2 files. For all file types, carriage returns and linefeeds are treated in a platform-agnostic way.
In the following example, myFile is a