AIODirEntry

Zusammenfassung

Contains methods to get the file path and other file attributes of a directory entry.

Diskussion

Hinweis:

This class cannot be instantiated directly. An instance of this class is returned by the AIO object's scandir method.

Eigenschaften

EigenschaftErläuterungDatentyp
cloud
(Schreibgeschützt)

An instance of a class that has cloud-specific methods. It is used to retrieve details of the cloud store that was used when the AIODirEntry object was created.

Returns a CloudDirEntryOp object.

cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    print(item.cloud.getvsipath())
Object
name
(Schreibgeschützt)

The entry's base file name relative to the scandir method's path argument.

cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    print(item.name)
local_io = AIO(r"c:\data")
for item in local_io.scandir(r'aio', -1):
    print(item.name)
String
path
(Schreibgeschützt)

The absolute path of the entry in the type specified in the scandir method.

cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    print(item.name)
local_io = AIO(r"c:\data")
for item in local_io.scandir(r'aio', -1):
    print(item.name)
String

Methodenübersicht

MethodeErläuterung
close ()

Closes the iterator (for cloud AIO only).

is_dir ()

Verifies whether an entry is a directory.

is_file ()

Verifies whether an entry is a file.

stat ()

Gets the stat result of the entry.

Methoden

close ()
cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    print(item.path)
    item.close()
is_dir ()
Rückgabewert
DatentypErläuterung
Boolean

Returns True if the entry is a directory; otherwise, returns False.

cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    print(item.is_dir())
local_io = AIO(r"c:\data")
for item in local_io.scandir(r'aio', -1):
    print(item.is_dir())
is_file ()
Rückgabewert
DatentypErläuterung
Boolean

Returns True if the entry is a file; otherwise, returns False.

cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    print(item.is_file())
local_io = AIO(r"c:\data")
for item in local_io.scandir(r'aio', -1):
    print(item.is_file())
stat ()
Rückgabewert
DatentypErläuterung
Object

Returns an os.stat_result object.

cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    ob = item.stat()
    print(ob.st_mode)
local_io = AIO(r"c:\data")
for item in local_io.scandir(r'aio', -1):
    ob = item.stat()
    print(ob.st_mode)