Types#
This page documents all types in OpenDAL.
Entry#
Entry.
An entry representing a path and its associated metadata.
Notes
If this entry is a directory, path must end with /.
Otherwise, path must not end with /.
EntryMode#
EntryMode.
The mode of an entry, indicating if it is a file or a directory.
Source code in python/opendal/types.pyi
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
Dir
instance-attribute
#
The entry is a directory and can be listed.
File
instance-attribute
#
The entry is a file and has data to read.
Unknown
instance-attribute
#
The mode of the entry is unknown.
is_dir()
#
Check if the entry mode is Dir.
Returns:
| Type | Description |
|---|---|
bool
|
True if the entry is a directory. |
Source code in python/opendal/types.pyi
68 69 70 71 72 73 74 75 76 | |
is_file()
#
Check if the entry mode is File.
Returns:
| Type | Description |
|---|---|
bool
|
True if the entry is a file. |
Source code in python/opendal/types.pyi
77 78 79 80 81 82 83 84 85 | |
Metadata#
The metadata of an Entry.
The metadata is always tied to a specific context and is not a global state. For example, two versions of the same path might have different content lengths.
Notes
In systems that support versioning, such as AWS S3, the metadata may
represent a specific version of a file. Use :attr:version to get
the version of a file if it is available.
content_disposition
property
#
The content disposition of this entry.
content_encoding
property
#
The content encoding of this entry.
content_length
property
#
The content length of this entry.
content_md5
property
#
The content MD5 of this entry.
content_type
property
#
The content type of this entry.
etag
property
#
The ETag of this entry.
is_dir
property
#
Whether this entry is a directory.
is_file
property
#
Whether this entry is a file.
last_modified
property
#
The last modified timestamp of this entry.
mode
property
#
The mode of this entry.
user_metadata
property
#
The user-defined metadata of this entry.
version
property
#
The version of this entry.