Mode in which to open a file.
Used to represent the position reference for calls to seek
.
Open file for appending.
Open file for appending. The file pointer will be at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, a new file is created for writing.
Open file for reading.
Open file for reading. The file pointer will be at the beginning of the file.
Open file for both reading and appending.
Open file for both reading and appending. The file pointer will be at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, a new file is created for writing.
Open file for both reading and writing.
Open file for both reading and writing. The file pointer will be at the beginning of the file.
Open file for both reading and writing.
Open file for both reading and writing. Overwrite the file if the file exists. If the file does not exist, creates a new file for writing.
Open file for writing only.
Open file for writing only. Overwrite the file if the file exists. If the file does not exist, creates a new file for writing.
Copies data from the file at oldPath
to a new file at newPath
.
Copies data from the file at oldPath
to a new file at newPath
.
Old file path.
New file path.
Boolean value indicating whether it is allowed to overwrite the file at newPath
, if one
already exists.
Deletes the file located at filePath
.
Deletes the file located at filePath
.
File path.
Deletes all the matching paths to the path pattern provided.
Deletes all the matching paths to the path pattern provided.
The pattern must follow the TensorFlow path pattern rules and it pattern must match all of a name (i.e., not just a substring). A pattern definition has the following form:
pattern: { term } term: '*': matches any sequence of non-'/' characters '?': matches a single non-'/' character '[' [ '^' ] { match-list } ']': matches any single character (not) on the list c: matches character c (c != '*', '?', '\\', '[') '\\' c: matches character c character-range: c: matches character c (c != '\\', '-', ']') '\\' c: matches character c lo '-' hi: matches character c for lo <= c <= hi
Path pattern.
Deletes everything under the provided path, recursively.
Deletes everything under the provided path, recursively.
Path to a file or directory.
Determines whether a path exists or not.
Determines whether a path exists or not.
Path to a file or directory.
true
if the path exists, whether its a file or a directory, and false
if the path does not exist and
there are no filesystem errors.
Returns file statistics for the provided path.
Returns file statistics for the provided path.
Path to a file or directory.
File statistics for the file/directory pointed to by path
.
Returns a file's last modified time.
Returns a file's last modified time.
Path to the file.
Time unit in which to return the last modified time. Defaults to TimeUnit.SECONDS.
Boolean value indicating whether or not to follow symbolic links. By default, symbolic
links are followed and the file attribute of the final target of the link is read. If
followSymbolicLinks
is set to false
, then symbolic links are not followed.
Gets all the matching paths to the path pattern provided.
Gets all the matching paths to the path pattern provided.
The pattern must follow the TensorFlow path pattern rules and it pattern must match all of a name (i.e., not just a substring). A pattern definition has the following form:
pattern: { term } term: '*': matches any sequence of non-'/' characters '?': matches a single non-'/' character '[' [ '^' ] { match-list } ']': matches any single character (not) on the list c: matches character c (c != '*', '?', '\\', '[') '\\' c: matches character c character-range: c: matches character c (c != '\\', '-', ']') '\\' c: matches character c lo '-' hi: matches character c for lo <= c <= hi
Path pattern.
Set of all paths matching the provided path pattern.
Returns true
is path
points to a directory, and false
otherwise.
Returns true
is path
points to a directory, and false
otherwise.
Path to a file or directory.
true
is path
points to a directory, and false
otherwise.
Returns true
if path
points to a Google Cloud Service (GCS) path.
Returns all entries contained within the directory at path
.
Returns all entries contained within the directory at path
. The returned sequence is in arbitrary order and it
does not contain the special entries "."
and ".."
.
Path to a directory.
Sequence of entries contained in the directory at path
.
NotFoundException
If the provided directory does not exist.
Creates a directory at path
, but requires that all the parent directories exist.
Creates a directory at path
, but requires that all the parent directories exist. If they may not exist,
mkDirs()
should be used instead. The call is also successful if a directory already exists at path
.
Directory path.
Creates a directory at path
, along with all necessary parent/intermediate directories.
Creates a directory at path
, along with all necessary parent/intermediate directories. The call is also
successful if a directory already exists at path
.
Directory path.
Reads the entire contents of the file located at filePath
to a string and returns it.
Rename/move data from the file/directory at oldPath
to a new file/directory at newPath
.
Rename/move data from the file/directory at oldPath
to a new file/directory at newPath
.
Old path.
New path.
Boolean value indicating whether it is allowed to overwrite the file/directory at newPath
, if
one already exists.
Walks a directory tree rooted at dirPath
recursively.
Walks a directory tree rooted at dirPath
recursively.
Note that exceptions that are thrown while listing directories are ignored.
Path to a directory from which to start traversing.
If true
, the top-level directories are returned first, otherwise they are returned last.
Stream over tuples containing: (i) the path for the directory, (ii) a sequence containing all of its subdirectories, and (iii) a sequence containing all files in that directory.
Writes the provided string to the file located at filePath
.
Writes the provided string to the file located at filePath
as an atomic operation.
Writes the provided string to the file located at filePath
as an atomic operation. This means that when
filePath
appears in the filesystem, it will contain all of content
. With writeStringToFile()
, it is possible
for the file to appear in the filesystem with content
only partially written.
The atomic write is achieved by first writing to a temporary file and then renaming that file.
Contains helper functions for dealing with file IO.