pyarrow.fs.FileInfo¶
-
class
pyarrow.fs.
FileInfo
¶ Bases:
pyarrow.lib._Weakrefable
FileSystem entry info.
- Parameters
path (str) – The full path to the filesystem entry.
type (FileType) – The type of the filesystem entry.
mtime (datetime or float, default None) – If given, the modification time of the filesystem entry. If a float is given, it is the number of seconds since the Unix epoch.
mtime_ns (int, default None) – If given, the modification time of the filesystem entry, in nanoseconds since the Unix epoch. mtime and mtime_ns are mutually exclusive.
size (int, default None) – If given, the filesystem entry size in bytes. This should only be given if type is FileType.File.
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(*args, **kwargs)Initialize self.
Attributes
The file base name.
The file extension.
The time of last modification, if available.
The time of last modification, if available, expressed in nanoseconds since the Unix epoch.
The full file path in the filesystem.
The size in bytes, if available.
Type of the file.
-
base_name
¶ The file base name.
Component after the last directory separator.
-
extension
¶ The file extension.
-
is_file
¶
-
mtime
¶ The time of last modification, if available.
- Returns
mtime (datetime.datetime or None)
-
mtime_ns
¶ The time of last modification, if available, expressed in nanoseconds since the Unix epoch.
- Returns
mtime_ns (int or None)
-
path
¶ The full file path in the filesystem.
-
size
¶ The size in bytes, if available.
Only regular files are guaranteed to have a size.
- Returns
size (int or None)
-
type
¶ Type of the file.
The returned enum values can be the following:
FileType.NotFound: target does not exist
FileType.Unknown: target exists but its type is unknown (could be a special file such as a Unix socket or character device, or Windows NUL / CON / …)
FileType.File: target is a regular file
FileType.Directory: target is a regular directory
- Returns
type (FileType)