This action will force synchronization from OpenHarmony-SIG/python, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
"""Constants/functions for interpreting results of os.stat() and os.lstat().Suggested usage: from stat import *"""# Indices for stat struct members in the tuple returned by os.stat()ST_MODE = 0ST_INO = 1ST_DEV = 2ST_NLINK = 3ST_UID = 4ST_GID = 5ST_SIZE = 6ST_ATIME = 7ST_MTIME = 8ST_CTIME = 9# Extract bits from the modedef S_IMODE(mode):"""Return the portion of the file's mode that can be set byos.chmod()."""return mode & 0o7777def S_IFMT(mode):"""Return the portion of the file's mode that describes thefile type."""return mode & 0o170000# Constants used as S_IFMT() for various file types# (not all are implemented on all systems)S_IFDIR = 0o040000 # directoryS_IFCHR = 0o020000 # character deviceS_IFBLK = 0o060000 # block deviceS_IFREG = 0o100000 # regular fileS_IFIFO = 0o010000 # fifo (named pipe)S_IFLNK = 0o120000 # symbolic linkS_IFSOCK = 0o140000 # socket file# Fallbacks for uncommon platform-specific constantsS_IFDOOR = 0S_IFPORT = 0S_IFWHT = 0# Functions to test for each file typedef S_ISDIR(mode):"""Return True if mode is from a directory."""return S_IFMT(mode) == S_IFDIRdef S_ISCHR(mode):"""Return True if mode is from a character special device file."""return S_IFMT(mode) == S_IFCHRdef S_ISBLK(mode):"""Return True if mode is from a block special device file."""return S_IFMT(mode) == S_IFBLKdef S_ISREG(mode):"""Return True if mode is from a regular file."""return S_IFMT(mode) == S_IFREGdef S_ISFIFO(mode):"""Return True if mode is from a FIFO (named pipe)."""return S_IFMT(mode) == S_IFIFOdef S_ISLNK(mode):"""Return True if mode is from a symbolic link."""return S_IFMT(mode) == S_IFLNKdef S_ISSOCK(mode):"""Return True if mode is from a socket."""return S_IFMT(mode) == S_IFSOCKdef S_ISDOOR(mode):"""Return True if mode is from a door."""return Falsedef S_ISPORT(mode):"""Return True if mode is from an event port."""return Falsedef S_ISWHT(mode):"""Return True if mode is from a whiteout."""return False# Names for permission bitsS_ISUID = 0o4000 # set UID bitS_ISGID = 0o2000 # set GID bitS_ENFMT = S_ISGID # file locking enforcementS_ISVTX = 0o1000 # sticky bitS_IREAD = 0o0400 # Unix V7 synonym for S_IRUSRS_IWRITE = 0o0200 # Unix V7 synonym for S_IWUSRS_IEXEC = 0o0100 # Unix V7 synonym for S_IXUSRS_IRWXU = 0o0700 # mask for owner permissionsS_IRUSR = 0o0400 # read by ownerS_IWUSR = 0o0200 # write by ownerS_IXUSR = 0o0100 # execute by ownerS_IRWXG = 0o0070 # mask for group permissionsS_IRGRP = 0o0040 # read by groupS_IWGRP = 0o0020 # write by groupS_IXGRP = 0o0010 # execute by groupS_IRWXO = 0o0007 # mask for others (not in group) permissionsS_IROTH = 0o0004 # read by othersS_IWOTH = 0o0002 # write by othersS_IXOTH = 0o0001 # execute by others# Names for file flagsUF_NODUMP = 0x00000001 # do not dump fileUF_IMMUTABLE = 0x00000002 # file may not be changedUF_APPEND = 0x00000004 # file may only be appended toUF_OPAQUE = 0x00000008 # directory is opaque when viewed through a union stackUF_NOUNLINK = 0x00000010 # file may not be renamed or deletedUF_COMPRESSED = 0x00000020 # OS X: file is hfs-compressedUF_HIDDEN = 0x00008000 # OS X: file should not be displayedSF_ARCHIVED = 0x00010000 # file may be archivedSF_IMMUTABLE = 0x00020000 # file may not be changedSF_APPEND = 0x00040000 # file may only be appended toSF_NOUNLINK = 0x00100000 # file may not be renamed or deletedSF_SNAPSHOT = 0x00200000 # file is a snapshot file_filemode_table = (((S_IFLNK, "l"),(S_IFSOCK, "s"), # Must appear before IFREG and IFDIR as IFSOCK == IFREG | IFDIR(S_IFREG, "-"),(S_IFBLK, "b"),(S_IFDIR, "d"),(S_IFCHR, "c"),(S_IFIFO, "p")),((S_IRUSR, "r"),),((S_IWUSR, "w"),),((S_IXUSR|S_ISUID, "s"),(S_ISUID, "S"),(S_IXUSR, "x")),((S_IRGRP, "r"),),((S_IWGRP, "w"),),((S_IXGRP|S_ISGID, "s"),(S_ISGID, "S"),(S_IXGRP, "x")),((S_IROTH, "r"),),((S_IWOTH, "w"),),((S_IXOTH|S_ISVTX, "t"),(S_ISVTX, "T"),(S_IXOTH, "x")))def filemode(mode):"""Convert a file's mode to a string of the form '-rwxrwxrwx'."""perm = []for table in _filemode_table:for bit, char in table:if mode & bit == bit:perm.append(char)breakelse:perm.append("-")return "".join(perm)# Windows FILE_ATTRIBUTE constants for interpreting os.stat()'s# "st_file_attributes" memberFILE_ATTRIBUTE_ARCHIVE = 32FILE_ATTRIBUTE_COMPRESSED = 2048FILE_ATTRIBUTE_DEVICE = 64FILE_ATTRIBUTE_DIRECTORY = 16FILE_ATTRIBUTE_ENCRYPTED = 16384FILE_ATTRIBUTE_HIDDEN = 2FILE_ATTRIBUTE_INTEGRITY_STREAM = 32768FILE_ATTRIBUTE_NORMAL = 128FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192FILE_ATTRIBUTE_NO_SCRUB_DATA = 131072FILE_ATTRIBUTE_OFFLINE = 4096FILE_ATTRIBUTE_READONLY = 1FILE_ATTRIBUTE_REPARSE_POINT = 1024FILE_ATTRIBUTE_SPARSE_FILE = 512FILE_ATTRIBUTE_SYSTEM = 4FILE_ATTRIBUTE_TEMPORARY = 256FILE_ATTRIBUTE_VIRTUAL = 65536# If available, use C implementationtry:from _stat import *except ImportError:pass
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。