Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
Python-3.10.14 /
Modules /
Delete
Unzip
Name
Size
Permission
Date
Action
_blake2
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
_ctypes
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
_decimal
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
_io
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
_multiprocessing
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
_sha3
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
_sqlite
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
_ssl
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
_xxtestfuzz
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
cjkcodecs
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
clinic
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
expat
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
README
112
B
-rw-r--r--
2024-03-19 22:46
Setup
15.15
KB
-rw-r--r--
2024-03-19 22:46
Setup.local
41
B
-rw-r--r--
2025-06-04 09:17
_abc.c
26.09
KB
-rw-r--r--
2024-03-19 22:46
_abc.gcda
8.21
KB
-rw-r--r--
2025-06-04 09:21
_abc.o
228.27
KB
-rw-r--r--
2025-06-04 09:22
_asynciomodule.c
88.39
KB
-rw-r--r--
2024-03-19 22:46
_bisectmodule.c
8.03
KB
-rw-r--r--
2024-03-19 22:46
_bz2module.c
23.65
KB
-rw-r--r--
2024-03-19 22:46
_codecsmodule.c
32.8
KB
-rw-r--r--
2024-03-19 22:46
_codecsmodule.gcda
13.72
KB
-rw-r--r--
2025-06-04 09:21
_codecsmodule.o
374.94
KB
-rw-r--r--
2025-06-04 09:22
_collectionsmodule.c
79.83
KB
-rw-r--r--
2024-03-19 22:46
_collectionsmodule.gcda
14.42
KB
-rw-r--r--
2025-06-04 09:21
_collectionsmodule.o
325.15
KB
-rw-r--r--
2025-06-04 09:22
_contextvarsmodule.c
1.57
KB
-rw-r--r--
2024-03-19 22:46
_cryptmodule.c
1.66
KB
-rw-r--r--
2024-03-19 22:46
_csv.c
50.09
KB
-rw-r--r--
2024-03-19 22:46
_curses_panel.c
18.6
KB
-rw-r--r--
2024-03-19 22:46
_cursesmodule.c
135.6
KB
-rw-r--r--
2024-03-19 22:46
_datetimemodule.c
219.13
KB
-rw-r--r--
2024-03-19 22:46
_dbmmodule.c
14.9
KB
-rw-r--r--
2024-03-19 22:46
_elementtree.c
124.95
KB
-rw-r--r--
2024-03-19 22:46
_functoolsmodule.c
45.07
KB
-rw-r--r--
2024-03-19 22:46
_functoolsmodule.gcda
11.74
KB
-rw-r--r--
2025-06-04 09:21
_functoolsmodule.o
268.69
KB
-rw-r--r--
2025-06-04 09:22
_gdbmmodule.c
21.25
KB
-rw-r--r--
2024-03-19 22:46
_hashopenssl.c
59.7
KB
-rw-r--r--
2024-03-19 22:46
_heapqmodule.c
21.78
KB
-rw-r--r--
2024-03-19 22:46
_iomodule.gcda
6.99
KB
-rw-r--r--
2025-06-04 09:21
_iomodule.o
186.38
KB
-rw-r--r--
2025-06-04 09:22
_json.c
57.57
KB
-rw-r--r--
2024-03-19 22:46
_localemodule.c
22.29
KB
-rw-r--r--
2024-03-19 22:46
_localemodule.gcda
8.57
KB
-rw-r--r--
2025-06-04 09:21
_localemodule.o
181.06
KB
-rw-r--r--
2025-06-04 09:22
_lsprof.c
25.89
KB
-rw-r--r--
2024-03-19 22:46
_lzmamodule.c
48.65
KB
-rw-r--r--
2024-03-19 22:46
_math.c
7.33
KB
-rw-r--r--
2024-03-19 22:46
_math.gcda
2.29
KB
-rw-r--r--
2025-06-04 09:21
_math.h
1007
B
-rw-r--r--
2024-03-19 22:46
_math.o
32.3
KB
-rw-r--r--
2025-06-04 09:22
_opcode.c
2.14
KB
-rw-r--r--
2024-03-19 22:46
_operator.c
46.15
KB
-rw-r--r--
2024-03-19 22:46
_operator.gcda
13.14
KB
-rw-r--r--
2025-06-04 09:21
_operator.o
333.74
KB
-rw-r--r--
2025-06-04 09:22
_pickle.c
229.53
KB
-rw-r--r--
2024-03-19 22:46
_posixsubprocess.c
36.98
KB
-rw-r--r--
2024-03-19 22:46
_queuemodule.c
12.31
KB
-rw-r--r--
2024-03-19 22:46
_randommodule.c
17.76
KB
-rw-r--r--
2024-03-19 22:46
_scproxy.c
6.08
KB
-rw-r--r--
2024-03-19 22:46
_sre.c
79.74
KB
-rw-r--r--
2024-03-19 22:46
_sre.gcda
34.64
KB
-rw-r--r--
2025-06-04 09:21
_sre.o
975.16
KB
-rw-r--r--
2025-06-04 09:22
_ssl.c
186.63
KB
-rw-r--r--
2024-03-19 22:46
_ssl.h
2.08
KB
-rw-r--r--
2024-03-19 22:46
_ssl_data.h
203.14
KB
-rw-r--r--
2024-03-19 22:46
_ssl_data_111.h
208.74
KB
-rw-r--r--
2024-03-19 22:46
_ssl_data_300.h
275.25
KB
-rw-r--r--
2024-03-19 22:46
_stat.c
15.18
KB
-rw-r--r--
2024-03-19 22:46
_stat.gcda
5.7
KB
-rw-r--r--
2025-06-04 09:21
_stat.o
69.77
KB
-rw-r--r--
2025-06-04 09:22
_statisticsmodule.c
4.83
KB
-rw-r--r--
2024-03-19 22:46
_struct.c
68.85
KB
-rw-r--r--
2024-03-19 22:46
_testbuffer.c
82.19
KB
-rw-r--r--
2024-03-19 22:46
_testcapimodule.c
217.47
KB
-rw-r--r--
2024-03-19 22:46
_testclinic.c
22.92
KB
-rw-r--r--
2024-03-19 22:46
_testimportmultiple.c
1.1
KB
-rw-r--r--
2024-03-19 22:46
_testinternalcapi.c
10.76
KB
-rw-r--r--
2024-03-19 22:46
_testmultiphase.c
23.38
KB
-rw-r--r--
2024-03-19 22:46
_threadmodule.c
50.27
KB
-rw-r--r--
2024-03-19 22:46
_threadmodule.gcda
10.46
KB
-rw-r--r--
2025-06-04 09:21
_threadmodule.o
250.8
KB
-rw-r--r--
2025-06-04 09:22
_tkinter.c
93.36
KB
-rw-r--r--
2024-03-19 22:46
_tracemalloc.c
44.86
KB
-rw-r--r--
2024-03-19 22:46
_tracemalloc.gcda
12.51
KB
-rw-r--r--
2025-06-04 09:21
_tracemalloc.o
262.77
KB
-rw-r--r--
2025-06-04 09:22
_uuidmodule.c
3
KB
-rw-r--r--
2024-03-19 22:46
_weakref.c
4.92
KB
-rw-r--r--
2024-03-19 22:46
_weakref.gcda
4.24
KB
-rw-r--r--
2025-06-04 09:21
_weakref.o
84.91
KB
-rw-r--r--
2025-06-04 09:22
_winapi.c
66.78
KB
-rw-r--r--
2024-03-19 22:46
_xxsubinterpretersmodule.c
67.74
KB
-rw-r--r--
2024-03-19 22:46
_zoneinfo.c
73.89
KB
-rw-r--r--
2024-03-19 22:46
addrinfo.h
5.88
KB
-rw-r--r--
2024-03-19 22:46
arraymodule.c
87.46
KB
-rw-r--r--
2024-03-19 22:46
atexitmodule.c
7.29
KB
-rw-r--r--
2024-03-19 22:46
atexitmodule.gcda
4.45
KB
-rw-r--r--
2025-06-04 09:21
atexitmodule.o
97.11
KB
-rw-r--r--
2025-06-04 09:22
audioop.c
59.71
KB
-rw-r--r--
2024-03-19 22:46
binascii.c
54.76
KB
-rw-r--r--
2024-03-19 22:46
bufferedio.gcda
20.46
KB
-rw-r--r--
2025-06-04 09:21
bufferedio.o
414.2
KB
-rw-r--r--
2025-06-04 09:22
bytesio.gcda
10.84
KB
-rw-r--r--
2025-06-04 09:21
bytesio.o
220.71
KB
-rw-r--r--
2025-06-04 09:22
cmathmodule.c
42.3
KB
-rw-r--r--
2024-03-19 22:46
config.c
3.21
KB
-rw-r--r--
2025-06-04 09:17
config.c.in
1.58
KB
-rw-r--r--
2024-03-19 22:46
config.o
34.5
KB
-rw-r--r--
2025-06-04 09:22
errnomodule.c
27.08
KB
-rw-r--r--
2024-03-19 22:46
errnomodule.gcda
8.02
KB
-rw-r--r--
2025-06-04 09:21
errnomodule.o
113.31
KB
-rw-r--r--
2025-06-04 09:22
faulthandler.c
40.52
KB
-rw-r--r--
2024-03-19 22:46
faulthandler.gcda
9.1
KB
-rw-r--r--
2025-06-04 09:21
faulthandler.o
147.28
KB
-rw-r--r--
2025-06-04 09:22
fcntlmodule.c
20.49
KB
-rw-r--r--
2024-03-19 22:46
fileio.gcda
9.01
KB
-rw-r--r--
2025-06-04 09:21
fileio.o
227.98
KB
-rw-r--r--
2025-06-04 09:22
gc_weakref.txt
11.19
KB
-rw-r--r--
2024-03-19 22:46
gcmodule.c
77.27
KB
-rw-r--r--
2024-03-19 22:46
gcmodule.gcda
11.63
KB
-rw-r--r--
2025-06-04 09:21
gcmodule.o
306.44
KB
-rw-r--r--
2025-06-04 09:22
getaddrinfo.c
18.38
KB
-rw-r--r--
2024-03-19 22:46
getbuildinfo.c
1.28
KB
-rw-r--r--
2024-03-19 22:46
getbuildinfo.gcda
3.59
KB
-rw-r--r--
2025-06-04 09:21
getbuildinfo.o
33.84
KB
-rw-r--r--
2025-06-04 09:22
getnameinfo.c
6.18
KB
-rw-r--r--
2024-03-19 22:46
getpath.c
44.99
KB
-rw-r--r--
2024-03-19 22:46
getpath.gcda
8.82
KB
-rw-r--r--
2025-06-04 09:21
getpath.o
160.52
KB
-rw-r--r--
2025-06-04 09:22
grpmodule.c
8.52
KB
-rw-r--r--
2024-03-19 22:46
hashlib.h
2.09
KB
-rw-r--r--
2024-03-19 22:46
iobase.gcda
9.63
KB
-rw-r--r--
2025-06-04 09:21
iobase.o
189.36
KB
-rw-r--r--
2025-06-04 09:22
itertoolsmodule.c
153.67
KB
-rw-r--r--
2024-03-19 22:46
itertoolsmodule.gcda
27.9
KB
-rw-r--r--
2025-06-04 09:21
itertoolsmodule.o
721.27
KB
-rw-r--r--
2025-06-04 09:22
ld_so_aix
6.12
KB
-rwxr-xr-x
2025-06-04 09:17
ld_so_aix.in
6.11
KB
-rw-r--r--
2024-03-19 22:46
main.c
17.65
KB
-rw-r--r--
2024-03-19 22:46
main.gcda
7.28
KB
-rw-r--r--
2025-06-04 09:21
main.o
147.24
KB
-rw-r--r--
2025-06-04 09:22
makesetup
7.67
KB
-rwxr-xr-x
2024-03-19 22:46
makexp_aix
2.67
KB
-rwxr-xr-x
2024-03-19 22:46
mathmodule.c
106.2
KB
-rw-r--r--
2024-03-19 22:46
md5module.c
15.51
KB
-rw-r--r--
2024-03-19 22:46
mmapmodule.c
47.75
KB
-rw-r--r--
2024-03-19 22:46
nismodule.c
12.89
KB
-rw-r--r--
2024-03-19 22:46
ossaudiodev.c
37.49
KB
-rw-r--r--
2024-03-19 22:46
overlapped.c
53.65
KB
-rw-r--r--
2024-03-19 22:46
posixmodule.c
413.46
KB
-rw-r--r--
2024-03-19 22:46
posixmodule.gcda
67.8
KB
-rw-r--r--
2025-06-04 09:21
posixmodule.h
791
B
-rw-r--r--
2024-03-19 22:46
posixmodule.o
1.49
MB
-rw-r--r--
2025-06-04 09:22
pwdmodule.c
8.89
KB
-rw-r--r--
2024-03-19 22:46
pwdmodule.gcda
4.96
KB
-rw-r--r--
2025-06-04 09:21
pwdmodule.o
84.35
KB
-rw-r--r--
2025-06-04 09:22
pyexpat.c
60.39
KB
-rw-r--r--
2024-03-19 22:46
readline.c
40.06
KB
-rw-r--r--
2024-03-19 22:46
resource.c
13.77
KB
-rw-r--r--
2024-03-19 22:46
rotatingtree.c
3.39
KB
-rw-r--r--
2024-03-19 22:46
rotatingtree.h
924
B
-rw-r--r--
2024-03-19 22:46
selectmodule.c
70.06
KB
-rw-r--r--
2024-03-19 22:46
sha1module.c
14.76
KB
-rw-r--r--
2024-03-19 22:46
sha256module.c
22.5
KB
-rw-r--r--
2024-03-19 22:46
sha512module.c
27.29
KB
-rw-r--r--
2024-03-19 22:46
signalmodule.c
52.45
KB
-rw-r--r--
2024-03-19 22:46
signalmodule.gcda
11.11
KB
-rw-r--r--
2025-06-04 09:21
signalmodule.o
235.02
KB
-rw-r--r--
2025-06-04 09:22
socketmodule.c
243.34
KB
-rw-r--r--
2024-03-19 22:46
socketmodule.h
8.56
KB
-rw-r--r--
2024-03-19 22:46
spwdmodule.c
6.69
KB
-rw-r--r--
2024-03-19 22:46
sre.h
2.83
KB
-rw-r--r--
2024-03-19 22:46
sre_constants.h
2.81
KB
-rw-r--r--
2024-03-19 22:46
sre_lib.h
52.08
KB
-rw-r--r--
2024-03-19 22:46
stringio.gcda
9.64
KB
-rw-r--r--
2025-06-04 09:21
stringio.o
193.45
KB
-rw-r--r--
2025-06-04 09:22
symtablemodule.c
3.67
KB
-rw-r--r--
2024-03-19 22:46
symtablemodule.gcda
4.25
KB
-rw-r--r--
2025-06-04 09:21
symtablemodule.o
55.01
KB
-rw-r--r--
2025-06-04 09:22
syslogmodule.c
10.64
KB
-rw-r--r--
2024-03-19 22:46
termios.c
22.52
KB
-rw-r--r--
2024-03-19 22:46
testcapi_long.h
6.77
KB
-rw-r--r--
2024-03-19 22:46
textio.gcda
23.51
KB
-rw-r--r--
2025-06-04 09:21
textio.o
645.09
KB
-rw-r--r--
2025-06-04 09:22
timemodule.c
57.23
KB
-rw-r--r--
2024-03-19 22:46
timemodule.gcda
8.3
KB
-rw-r--r--
2025-06-04 09:21
timemodule.o
177.2
KB
-rw-r--r--
2025-06-04 09:22
tkappinit.c
4.71
KB
-rw-r--r--
2024-03-19 22:46
tkinter.h
881
B
-rw-r--r--
2024-03-19 22:46
unicodedata.c
44.69
KB
-rw-r--r--
2024-03-19 22:46
unicodedata_db.h
531.75
KB
-rw-r--r--
2024-03-19 22:46
unicodename_db.h
2.12
MB
-rw-r--r--
2024-03-19 22:46
winreparse.h
1.59
KB
-rw-r--r--
2024-03-19 22:46
xxlimited.c
9.23
KB
-rw-r--r--
2024-03-19 22:46
xxlimited_35.c
6.88
KB
-rw-r--r--
2024-03-19 22:46
xxmodule.c
12.56
KB
-rw-r--r--
2024-03-19 22:46
xxsubtype.c
10.78
KB
-rw-r--r--
2024-03-19 22:46
xxsubtype.gcda
4.45
KB
-rw-r--r--
2025-06-04 09:21
xxsubtype.o
54.38
KB
-rw-r--r--
2025-06-04 09:22
zlibmodule.c
46.52
KB
-rw-r--r--
2024-03-19 22:46
Save
Rename
/* stat.h interface * * The module defines all S_IF*, S_I*, UF_*, SF_* and ST_* constants to * sensible default values as well as defines S_IS*() macros in order to keep * backward compatibility with the old stat.py module. * * New constants and macros such as S_IFDOOR / S_ISDOOR() are always defined * as int 0. * * NOTE: POSIX only defines the values of the S_I* permission bits. * */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif /* HAVE_SYS_TYPES_H */ #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif /* HAVE_SYS_STAT_H */ #ifdef MS_WINDOWS #include <windows.h> typedef unsigned short mode_t; /* FILE_ATTRIBUTE_INTEGRITY_STREAM and FILE_ATTRIBUTE_NO_SCRUB_DATA are not present in VC2010, so define them manually */ #ifndef FILE_ATTRIBUTE_INTEGRITY_STREAM # define FILE_ATTRIBUTE_INTEGRITY_STREAM 0x8000 #endif #ifndef FILE_ATTRIBUTE_NO_SCRUB_DATA # define FILE_ATTRIBUTE_NO_SCRUB_DATA 0x20000 #endif #ifndef IO_REPARSE_TAG_APPEXECLINK # define IO_REPARSE_TAG_APPEXECLINK 0x8000001BL #endif #endif /* MS_WINDOWS */ /* From Python's stat.py */ #ifndef S_IMODE # define S_IMODE 07777 #endif /* S_IFXXX constants (file types) * * Only the names are defined by POSIX but not their value. All common file * types seems to have the same numeric value on all platforms, though. * * pyport.h guarantees S_IFMT, S_IFDIR, S_IFCHR, S_IFREG and S_IFLNK */ #ifndef S_IFBLK # define S_IFBLK 0060000 #endif #ifndef S_IFIFO # define S_IFIFO 0010000 #endif #ifndef S_IFSOCK # define S_IFSOCK 0140000 #endif #ifndef S_IFDOOR # define S_IFDOOR 0 #endif #ifndef S_IFPORT # define S_IFPORT 0 #endif #ifndef S_IFWHT # define S_IFWHT 0 #endif /* S_ISXXX() * pyport.h defines S_ISDIR(), S_ISREG() and S_ISCHR() */ #ifndef S_ISBLK # define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK) #endif #ifndef S_ISFIFO # define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) #endif #ifndef S_ISLNK # define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) #endif #ifndef S_ISSOCK # define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK) #endif #ifndef S_ISDOOR # define S_ISDOOR(mode) 0 #endif #ifndef S_ISPORT # define S_ISPORT(mode) 0 #endif #ifndef S_ISWHT # define S_ISWHT(mode) 0 #endif /* S_I* file permission * * The permission bit value are defined by POSIX standards. */ #ifndef S_ISUID # define S_ISUID 04000 #endif #ifndef S_ISGID # define S_ISGID 02000 #endif /* what is S_ENFMT? */ #ifndef S_ENFMT # define S_ENFMT S_ISGID #endif #ifndef S_ISVTX # define S_ISVTX 01000 #endif #ifndef S_IREAD # define S_IREAD 00400 #endif #ifndef S_IWRITE # define S_IWRITE 00200 #endif #ifndef S_IEXEC # define S_IEXEC 00100 #endif #ifndef S_IRWXU # define S_IRWXU 00700 #endif #ifndef S_IRUSR # define S_IRUSR 00400 #endif #ifndef S_IWUSR # define S_IWUSR 00200 #endif #ifndef S_IXUSR # define S_IXUSR 00100 #endif #ifndef S_IRWXG # define S_IRWXG 00070 #endif #ifndef S_IRGRP # define S_IRGRP 00040 #endif #ifndef S_IWGRP # define S_IWGRP 00020 #endif #ifndef S_IXGRP # define S_IXGRP 00010 #endif #ifndef S_IRWXO # define S_IRWXO 00007 #endif #ifndef S_IROTH # define S_IROTH 00004 #endif #ifndef S_IWOTH # define S_IWOTH 00002 #endif #ifndef S_IXOTH # define S_IXOTH 00001 #endif /* Names for file flags */ #ifndef UF_NODUMP # define UF_NODUMP 0x00000001 #endif #ifndef UF_IMMUTABLE # define UF_IMMUTABLE 0x00000002 #endif #ifndef UF_APPEND # define UF_APPEND 0x00000004 #endif #ifndef UF_OPAQUE # define UF_OPAQUE 0x00000008 #endif #ifndef UF_NOUNLINK # define UF_NOUNLINK 0x00000010 #endif #ifndef UF_COMPRESSED # define UF_COMPRESSED 0x00000020 #endif #ifndef UF_HIDDEN # define UF_HIDDEN 0x00008000 #endif #ifndef SF_ARCHIVED # define SF_ARCHIVED 0x00010000 #endif #ifndef SF_IMMUTABLE # define SF_IMMUTABLE 0x00020000 #endif #ifndef SF_APPEND # define SF_APPEND 0x00040000 #endif #ifndef SF_NOUNLINK # define SF_NOUNLINK 0x00100000 #endif #ifndef SF_SNAPSHOT # define SF_SNAPSHOT 0x00200000 #endif static mode_t _PyLong_AsMode_t(PyObject *op) { unsigned long value; mode_t mode; value = PyLong_AsUnsignedLong(op); if ((value == (unsigned long)-1) && PyErr_Occurred()) return (mode_t)-1; mode = (mode_t)value; if ((unsigned long)mode != value) { PyErr_SetString(PyExc_OverflowError, "mode out of range"); return (mode_t)-1; } return mode; } #define stat_S_ISFUNC(isfunc, doc) \ static PyObject * \ stat_ ##isfunc (PyObject *self, PyObject *omode) \ { \ mode_t mode = _PyLong_AsMode_t(omode); \ if ((mode == (mode_t)-1) && PyErr_Occurred()) \ return NULL; \ return PyBool_FromLong(isfunc(mode)); \ } \ PyDoc_STRVAR(stat_ ## isfunc ## _doc, doc) stat_S_ISFUNC(S_ISDIR, "S_ISDIR(mode) -> bool\n\n" "Return True if mode is from a directory."); stat_S_ISFUNC(S_ISCHR, "S_ISCHR(mode) -> bool\n\n" "Return True if mode is from a character special device file."); stat_S_ISFUNC(S_ISBLK, "S_ISBLK(mode) -> bool\n\n" "Return True if mode is from a block special device file."); stat_S_ISFUNC(S_ISREG, "S_ISREG(mode) -> bool\n\n" "Return True if mode is from a regular file."); stat_S_ISFUNC(S_ISFIFO, "S_ISFIFO(mode) -> bool\n\n" "Return True if mode is from a FIFO (named pipe)."); stat_S_ISFUNC(S_ISLNK, "S_ISLNK(mode) -> bool\n\n" "Return True if mode is from a symbolic link."); stat_S_ISFUNC(S_ISSOCK, "S_ISSOCK(mode) -> bool\n\n" "Return True if mode is from a socket."); stat_S_ISFUNC(S_ISDOOR, "S_ISDOOR(mode) -> bool\n\n" "Return True if mode is from a door."); stat_S_ISFUNC(S_ISPORT, "S_ISPORT(mode) -> bool\n\n" "Return True if mode is from an event port."); stat_S_ISFUNC(S_ISWHT, "S_ISWHT(mode) -> bool\n\n" "Return True if mode is from a whiteout."); PyDoc_STRVAR(stat_S_IMODE_doc, "Return the portion of the file's mode that can be set by os.chmod()."); static PyObject * stat_S_IMODE(PyObject *self, PyObject *omode) { mode_t mode = _PyLong_AsMode_t(omode); if ((mode == (mode_t)-1) && PyErr_Occurred()) return NULL; return PyLong_FromUnsignedLong(mode & S_IMODE); } PyDoc_STRVAR(stat_S_IFMT_doc, "Return the portion of the file's mode that describes the file type."); static PyObject * stat_S_IFMT(PyObject *self, PyObject *omode) { mode_t mode = _PyLong_AsMode_t(omode); if ((mode == (mode_t)-1) && PyErr_Occurred()) return NULL; return PyLong_FromUnsignedLong(mode & S_IFMT); } /* file type chars according to http://en.wikibooks.org/wiki/C_Programming/POSIX_Reference/sys/stat.h */ static char filetype(mode_t mode) { /* common cases first */ if (S_ISREG(mode)) return '-'; if (S_ISDIR(mode)) return 'd'; if (S_ISLNK(mode)) return 'l'; /* special files */ if (S_ISBLK(mode)) return 'b'; if (S_ISCHR(mode)) return 'c'; if (S_ISFIFO(mode)) return 'p'; if (S_ISSOCK(mode)) return 's'; /* non-standard types */ if (S_ISDOOR(mode)) return 'D'; if (S_ISPORT(mode)) return 'P'; if (S_ISWHT(mode)) return 'w'; /* unknown */ return '?'; } static void fileperm(mode_t mode, char *buf) { buf[0] = mode & S_IRUSR ? 'r' : '-'; buf[1] = mode & S_IWUSR ? 'w' : '-'; if (mode & S_ISUID) { buf[2] = mode & S_IXUSR ? 's' : 'S'; } else { buf[2] = mode & S_IXUSR ? 'x' : '-'; } buf[3] = mode & S_IRGRP ? 'r' : '-'; buf[4] = mode & S_IWGRP ? 'w' : '-'; if (mode & S_ISGID) { buf[5] = mode & S_IXGRP ? 's' : 'S'; } else { buf[5] = mode & S_IXGRP ? 'x' : '-'; } buf[6] = mode & S_IROTH ? 'r' : '-'; buf[7] = mode & S_IWOTH ? 'w' : '-'; if (mode & S_ISVTX) { buf[8] = mode & S_IXOTH ? 't' : 'T'; } else { buf[8] = mode & S_IXOTH ? 'x' : '-'; } } PyDoc_STRVAR(stat_filemode_doc, "Convert a file's mode to a string of the form '-rwxrwxrwx'"); static PyObject * stat_filemode(PyObject *self, PyObject *omode) { char buf[10]; mode_t mode; mode = _PyLong_AsMode_t(omode); if ((mode == (mode_t)-1) && PyErr_Occurred()) return NULL; buf[0] = filetype(mode); fileperm(mode, &buf[1]); return PyUnicode_FromStringAndSize(buf, 10); } static PyMethodDef stat_methods[] = { {"S_ISDIR", stat_S_ISDIR, METH_O, stat_S_ISDIR_doc}, {"S_ISCHR", stat_S_ISCHR, METH_O, stat_S_ISCHR_doc}, {"S_ISBLK", stat_S_ISBLK, METH_O, stat_S_ISBLK_doc}, {"S_ISREG", stat_S_ISREG, METH_O, stat_S_ISREG_doc}, {"S_ISFIFO", stat_S_ISFIFO, METH_O, stat_S_ISFIFO_doc}, {"S_ISLNK", stat_S_ISLNK, METH_O, stat_S_ISLNK_doc}, {"S_ISSOCK", stat_S_ISSOCK, METH_O, stat_S_ISSOCK_doc}, {"S_ISDOOR", stat_S_ISDOOR, METH_O, stat_S_ISDOOR_doc}, {"S_ISPORT", stat_S_ISPORT, METH_O, stat_S_ISPORT_doc}, {"S_ISWHT", stat_S_ISWHT, METH_O, stat_S_ISWHT_doc}, {"S_IMODE", stat_S_IMODE, METH_O, stat_S_IMODE_doc}, {"S_IFMT", stat_S_IFMT, METH_O, stat_S_IFMT_doc}, {"filemode", stat_filemode, METH_O, stat_filemode_doc}, {NULL, NULL} /* sentinel */ }; PyDoc_STRVAR(module_doc, "S_IFMT_: file type bits\n\ S_IFDIR: directory\n\ S_IFCHR: character device\n\ S_IFBLK: block device\n\ S_IFREG: regular file\n\ S_IFIFO: fifo (named pipe)\n\ S_IFLNK: symbolic link\n\ S_IFSOCK: socket file\n\ S_IFDOOR: door\n\ S_IFPORT: event port\n\ S_IFWHT: whiteout\n\ \n" "S_ISUID: set UID bit\n\ S_ISGID: set GID bit\n\ S_ENFMT: file locking enforcement\n\ S_ISVTX: sticky bit\n\ S_IREAD: Unix V7 synonym for S_IRUSR\n\ S_IWRITE: Unix V7 synonym for S_IWUSR\n\ S_IEXEC: Unix V7 synonym for S_IXUSR\n\ S_IRWXU: mask for owner permissions\n\ S_IRUSR: read by owner\n\ S_IWUSR: write by owner\n\ S_IXUSR: execute by owner\n\ S_IRWXG: mask for group permissions\n\ S_IRGRP: read by group\n\ S_IWGRP: write by group\n\ S_IXGRP: execute by group\n\ S_IRWXO: mask for others (not in group) permissions\n\ S_IROTH: read by others\n\ S_IWOTH: write by others\n\ S_IXOTH: execute by others\n\ \n" "UF_NODUMP: do not dump file\n\ UF_IMMUTABLE: file may not be changed\n\ UF_APPEND: file may only be appended to\n\ UF_OPAQUE: directory is opaque when viewed through a union stack\n\ UF_NOUNLINK: file may not be renamed or deleted\n\ UF_COMPRESSED: OS X: file is hfs-compressed\n\ UF_HIDDEN: OS X: file should not be displayed\n\ SF_ARCHIVED: file may be archived\n\ SF_IMMUTABLE: file may not be changed\n\ SF_APPEND: file may only be appended to\n\ SF_NOUNLINK: file may not be renamed or deleted\n\ SF_SNAPSHOT: file is a snapshot file\n\ \n" "ST_MODE\n\ ST_INO\n\ ST_DEV\n\ ST_NLINK\n\ ST_UID\n\ ST_GID\n\ ST_SIZE\n\ ST_ATIME\n\ ST_MTIME\n\ ST_CTIME\n\ \n" "FILE_ATTRIBUTE_*: Windows file attribute constants\n\ (only present on Windows)\n\ "); static int stat_exec(PyObject *module) { #define ADD_INT_MACRO(module, macro) \ do { \ if (PyModule_AddIntConstant(module, #macro, macro) < 0) { \ return -1; \ } \ } while (0) ADD_INT_MACRO(module, S_IFDIR); ADD_INT_MACRO(module, S_IFCHR); ADD_INT_MACRO(module, S_IFBLK); ADD_INT_MACRO(module, S_IFREG); ADD_INT_MACRO(module, S_IFIFO); ADD_INT_MACRO(module, S_IFLNK); ADD_INT_MACRO(module, S_IFSOCK); ADD_INT_MACRO(module, S_IFDOOR); ADD_INT_MACRO(module, S_IFPORT); ADD_INT_MACRO(module, S_IFWHT); ADD_INT_MACRO(module, S_ISUID); ADD_INT_MACRO(module, S_ISGID); ADD_INT_MACRO(module, S_ISVTX); ADD_INT_MACRO(module, S_ENFMT); ADD_INT_MACRO(module, S_IREAD); ADD_INT_MACRO(module, S_IWRITE); ADD_INT_MACRO(module, S_IEXEC); ADD_INT_MACRO(module, S_IRWXU); ADD_INT_MACRO(module, S_IRUSR); ADD_INT_MACRO(module, S_IWUSR); ADD_INT_MACRO(module, S_IXUSR); ADD_INT_MACRO(module, S_IRWXG); ADD_INT_MACRO(module, S_IRGRP); ADD_INT_MACRO(module, S_IWGRP); ADD_INT_MACRO(module, S_IXGRP); ADD_INT_MACRO(module, S_IRWXO); ADD_INT_MACRO(module, S_IROTH); ADD_INT_MACRO(module, S_IWOTH); ADD_INT_MACRO(module, S_IXOTH); ADD_INT_MACRO(module, UF_NODUMP); ADD_INT_MACRO(module, UF_IMMUTABLE); ADD_INT_MACRO(module, UF_APPEND); ADD_INT_MACRO(module, UF_OPAQUE); ADD_INT_MACRO(module, UF_NOUNLINK); ADD_INT_MACRO(module, UF_COMPRESSED); ADD_INT_MACRO(module, UF_HIDDEN); ADD_INT_MACRO(module, SF_ARCHIVED); ADD_INT_MACRO(module, SF_IMMUTABLE); ADD_INT_MACRO(module, SF_APPEND); ADD_INT_MACRO(module, SF_NOUNLINK); ADD_INT_MACRO(module, SF_SNAPSHOT); const char* st_constants[] = { "ST_MODE", "ST_INO", "ST_DEV", "ST_NLINK", "ST_UID", "ST_GID", "ST_SIZE", "ST_ATIME", "ST_MTIME", "ST_CTIME" }; for (int i = 0; i < (int)Py_ARRAY_LENGTH(st_constants); i++) { if (PyModule_AddIntConstant(module, st_constants[i], i) < 0) { return -1; } } #ifdef MS_WINDOWS ADD_INT_MACRO(module, FILE_ATTRIBUTE_ARCHIVE); ADD_INT_MACRO(module, FILE_ATTRIBUTE_COMPRESSED); ADD_INT_MACRO(module, FILE_ATTRIBUTE_DEVICE); ADD_INT_MACRO(module, FILE_ATTRIBUTE_DIRECTORY); ADD_INT_MACRO(module, FILE_ATTRIBUTE_ENCRYPTED); ADD_INT_MACRO(module, FILE_ATTRIBUTE_HIDDEN); ADD_INT_MACRO(module, FILE_ATTRIBUTE_INTEGRITY_STREAM); ADD_INT_MACRO(module, FILE_ATTRIBUTE_NORMAL); ADD_INT_MACRO(module, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED); ADD_INT_MACRO(module, FILE_ATTRIBUTE_NO_SCRUB_DATA); ADD_INT_MACRO(module, FILE_ATTRIBUTE_OFFLINE); ADD_INT_MACRO(module, FILE_ATTRIBUTE_READONLY); ADD_INT_MACRO(module, FILE_ATTRIBUTE_REPARSE_POINT); ADD_INT_MACRO(module, FILE_ATTRIBUTE_SPARSE_FILE); ADD_INT_MACRO(module, FILE_ATTRIBUTE_SYSTEM); ADD_INT_MACRO(module, FILE_ATTRIBUTE_TEMPORARY); ADD_INT_MACRO(module, FILE_ATTRIBUTE_VIRTUAL); if (PyModule_AddObject(module, "IO_REPARSE_TAG_SYMLINK", PyLong_FromUnsignedLong(IO_REPARSE_TAG_SYMLINK)) < 0) { return -1; } if (PyModule_AddObject(module, "IO_REPARSE_TAG_MOUNT_POINT", PyLong_FromUnsignedLong(IO_REPARSE_TAG_MOUNT_POINT)) < 0) { return -1; } if (PyModule_AddObject(module, "IO_REPARSE_TAG_APPEXECLINK", PyLong_FromUnsignedLong(IO_REPARSE_TAG_APPEXECLINK)) < 0) { return -1; } #endif return 0; } static PyModuleDef_Slot stat_slots[] = { {Py_mod_exec, stat_exec}, {0, NULL} }; static struct PyModuleDef statmodule = { PyModuleDef_HEAD_INIT, .m_name = "_stat", .m_doc = module_doc, .m_size = 0, .m_methods = stat_methods, .m_slots = stat_slots, }; PyMODINIT_FUNC PyInit__stat(void) { return PyModuleDef_Init(&statmodule); } #ifdef __cplusplus } #endif