Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
32200aea
Kaydet (Commit)
32200aea
authored
Haz 01, 2002
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced obsolete stat module constants with equivalent attributes
üst
16e3c427
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
59 additions
and
79 deletions
+59
-79
CGIHTTPServer.py
Lib/CGIHTTPServer.py
+1
-1
compileall.py
Lib/compileall.py
+2
-3
dircache.py
Lib/dircache.py
+1
-1
dospath.py
Lib/dospath.py
+5
-8
filecmp.py
Lib/filecmp.py
+5
-5
imputil.py
Lib/imputil.py
+2
-2
linecache.py
Lib/linecache.py
+2
-3
macpath.py
Lib/macpath.py
+5
-8
mhlib.py
Lib/mhlib.py
+2
-5
ntpath.py
Lib/ntpath.py
+5
-8
os2emxpath.py
Lib/os2emxpath.py
+5
-8
posixpath.py
Lib/posixpath.py
+12
-15
pstats.py
Lib/pstats.py
+1
-1
py_compile.py
Lib/py_compile.py
+2
-2
pydoc.py
Lib/pydoc.py
+4
-4
statcache.py
Lib/statcache.py
+1
-1
uu.py
Lib/uu.py
+1
-1
zipfile.py
Lib/zipfile.py
+3
-3
No files found.
Lib/CGIHTTPServer.py
Dosyayı görüntüle @
32200aea
...
...
@@ -308,7 +308,7 @@ def executable(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
st
[
0
]
&
0111
!=
0
return
st
.
st_mode
&
0111
!=
0
def
test
(
HandlerClass
=
CGIHTTPRequestHandler
,
...
...
Lib/compileall.py
Dosyayı görüntüle @
32200aea
...
...
@@ -13,7 +13,6 @@ See module py_compile for details of the actual byte-compilation.
"""
import
os
import
stat
import
sys
import
py_compile
...
...
@@ -56,8 +55,8 @@ def compile_dir(dir, maxlevels=10, ddir=None,
head
,
tail
=
name
[:
-
3
],
name
[
-
3
:]
if
tail
==
'.py'
:
cfile
=
fullname
+
(
__debug__
and
'c'
or
'o'
)
ftime
=
os
.
stat
(
fullname
)
[
stat
.
ST_MTIME
]
try
:
ctime
=
os
.
stat
(
cfile
)
[
stat
.
ST_MTIME
]
ftime
=
os
.
stat
(
fullname
)
.
st_mtime
try
:
ctime
=
os
.
stat
(
cfile
)
.
st_mtime
except
os
.
error
:
ctime
=
0
if
(
ctime
>
ftime
)
and
not
force
:
continue
if
not
quiet
:
...
...
Lib/dircache.py
Dosyayı görüntüle @
32200aea
...
...
@@ -23,7 +23,7 @@ def listdir(path):
except
KeyError
:
cached_mtime
,
list
=
-
1
,
[]
try
:
mtime
=
os
.
stat
(
path
)
[
8
]
mtime
=
os
.
stat
(
path
)
.
st_mtime
except
os
.
error
:
return
[]
if
mtime
!=
cached_mtime
:
...
...
Lib/dospath.py
Dosyayı görüntüle @
32200aea
...
...
@@ -123,19 +123,16 @@ def commonprefix(m):
def
getsize
(
filename
):
"""Return the size of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_SIZE
]
return
os
.
stat
(
filename
)
.
st_size
def
getmtime
(
filename
):
"""Return the last modification time of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_MTIME
]
return
os
.
stat
(
filename
)
.
st_mtime
def
getatime
(
filename
):
"""Return the last access time of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_ATIME
]
return
os
.
stat
(
filename
)
.
st_atime
def
islink
(
path
):
"""Is a path a symbolic link?
...
...
@@ -162,7 +159,7 @@ def isdir(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
stat
.
S_ISDIR
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISDIR
(
st
.
st_mode
)
def
isfile
(
path
):
...
...
@@ -172,7 +169,7 @@ def isfile(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
stat
.
S_ISREG
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISREG
(
st
.
st_mode
)
def
ismount
(
path
):
...
...
Lib/filecmp.py
Dosyayı görüntüle @
32200aea
...
...
@@ -64,9 +64,9 @@ def cmp(f1, f2, shallow=1, use_statcache=0):
return
outcome
def
_sig
(
st
):
return
(
stat
.
S_IFMT
(
st
[
stat
.
ST_MODE
]
),
st
[
stat
.
ST_SIZE
]
,
st
[
stat
.
ST_MTIME
]
)
return
(
stat
.
S_IFMT
(
st
.
st_mode
),
st
.
st_size
,
st
.
st_mtime
)
def
_do_cmp
(
f1
,
f2
):
bufsize
=
BUFSIZE
...
...
@@ -199,8 +199,8 @@ class dircmp:
ok
=
0
if
ok
:
a_type
=
stat
.
S_IFMT
(
a_stat
[
stat
.
ST_MODE
]
)
b_type
=
stat
.
S_IFMT
(
b_stat
[
stat
.
ST_MODE
]
)
a_type
=
stat
.
S_IFMT
(
a_stat
.
st_mode
)
b_type
=
stat
.
S_IFMT
(
b_stat
.
st_mode
)
if
a_type
!=
b_type
:
self
.
common_funny
.
append
(
x
)
elif
stat
.
S_ISDIR
(
a_type
):
...
...
Lib/imputil.py
Dosyayı görüntüle @
32200aea
...
...
@@ -484,7 +484,7 @@ def _os_path_isdir(pathname):
s
=
_os_stat
(
pathname
)
except
OSError
:
return
None
return
(
s
[
0
]
&
0170000
)
==
0040000
return
(
s
.
st_mode
&
0170000
)
==
0040000
def
_timestamp
(
pathname
):
"Return the file modification time as a Long."
...
...
@@ -492,7 +492,7 @@ def _timestamp(pathname):
s
=
_os_stat
(
pathname
)
except
OSError
:
return
None
return
long
(
s
[
8
]
)
return
long
(
s
.
st_mtime
)
######################################################################
...
...
Lib/linecache.py
Dosyayı görüntüle @
32200aea
...
...
@@ -7,7 +7,6 @@ that name.
import
sys
import
os
from
stat
import
*
__all__
=
[
"getline"
,
"clearcache"
,
"checkcache"
]
...
...
@@ -52,7 +51,7 @@ def checkcache():
except
os
.
error
:
del
cache
[
filename
]
continue
if
size
!=
stat
[
ST_SIZE
]
or
mtime
!=
stat
[
ST_MTIME
]
:
if
size
!=
stat
.
st_size
or
mtime
!=
stat
.
st_mtime
:
del
cache
[
filename
]
...
...
@@ -96,6 +95,6 @@ def updatecache(filename):
except
IOError
,
msg
:
## print '*** Cannot open', fullname, ':', msg
return
[]
size
,
mtime
=
stat
[
ST_SIZE
],
stat
[
ST_MTIME
]
size
,
mtime
=
stat
.
st_size
,
stat
.
st_mtime
cache
[
filename
]
=
size
,
mtime
,
lines
,
fullname
return
lines
Lib/macpath.py
Dosyayı görüntüle @
32200aea
...
...
@@ -100,25 +100,22 @@ def isdir(s):
st
=
os
.
stat
(
s
)
except
os
.
error
:
return
0
return
S_ISDIR
(
st
[
ST_MODE
]
)
return
S_ISDIR
(
st
.
st_mode
)
# Get size, mtime, atime of files.
def
getsize
(
filename
):
"""Return the size of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
ST_SIZE
]
return
os
.
stat
(
filename
)
.
st_size
def
getmtime
(
filename
):
"""Return the last modification time of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
ST_MTIME
]
return
os
.
stat
(
filename
)
.
st_mtime
def
getatime
(
filename
):
"""Return the last access time of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
ST_ATIME
]
return
os
.
stat
(
filename
)
.
st_atime
def
islink
(
s
):
...
...
@@ -138,7 +135,7 @@ def isfile(s):
st
=
os
.
stat
(
s
)
except
os
.
error
:
return
False
return
S_ISREG
(
st
[
ST_MODE
]
)
return
S_ISREG
(
st
.
st_mode
)
def
exists
(
s
):
...
...
Lib/mhlib.py
Dosyayı görüntüle @
32200aea
...
...
@@ -74,7 +74,6 @@ FOLDER_PROTECT = 0700
import
os
import
sys
from
stat
import
ST_NLINK
import
re
import
mimetools
import
multifile
...
...
@@ -155,8 +154,7 @@ class MH:
fullname
=
os
.
path
.
join
(
self
.
path
,
name
)
# Get the link count so we can avoid listing folders
# that have no subfolders.
st
=
os
.
stat
(
fullname
)
nlinks
=
st
[
ST_NLINK
]
nlinks
=
os
.
stat
(
fullname
)
.
st_nlink
if
nlinks
<=
2
:
return
[]
subfolders
=
[]
...
...
@@ -183,8 +181,7 @@ class MH:
fullname
=
os
.
path
.
join
(
self
.
path
,
name
)
# Get the link count so we can avoid listing folders
# that have no subfolders.
st
=
os
.
stat
(
fullname
)
nlinks
=
st
[
ST_NLINK
]
nlinks
=
os
.
stat
(
fullname
)
.
st_nlink
if
nlinks
<=
2
:
return
[]
subfolders
=
[]
...
...
Lib/ntpath.py
Dosyayı görüntüle @
32200aea
...
...
@@ -216,18 +216,15 @@ def commonprefix(m):
def
getsize
(
filename
):
"""Return the size of a file, reported by os.stat()"""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_SIZE
]
return
os
.
stat
(
filename
)
.
st_size
def
getmtime
(
filename
):
"""Return the last modification time of a file, reported by os.stat()"""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_MTIME
]
return
os
.
stat
(
filename
)
.
st_mtime
def
getatime
(
filename
):
"""Return the last access time of a file, reported by os.stat()"""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_ATIME
]
return
os
.
stat
(
filename
)
.
st_atime
# Is a path a symbolic link?
...
...
@@ -260,7 +257,7 @@ def isdir(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
stat
.
S_ISDIR
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISDIR
(
st
.
st_mode
)
# Is a path a regular file?
...
...
@@ -273,7 +270,7 @@ def isfile(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
stat
.
S_ISREG
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISREG
(
st
.
st_mode
)
# Is a path a mount point? Either a root (with or without drive letter)
...
...
Lib/os2emxpath.py
Dosyayı görüntüle @
32200aea
...
...
@@ -175,18 +175,15 @@ def commonprefix(m):
def
getsize
(
filename
):
"""Return the size of a file, reported by os.stat()"""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_SIZE
]
return
os
.
stat
(
filename
)
.
st_size
def
getmtime
(
filename
):
"""Return the last modification time of a file, reported by os.stat()"""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_MTIME
]
return
os
.
stat
(
filename
)
.
st_mtime
def
getatime
(
filename
):
"""Return the last access time of a file, reported by os.stat()"""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_ATIME
]
return
os
.
stat
(
filename
)
.
st_atime
# Is a path a symbolic link?
...
...
@@ -217,7 +214,7 @@ def isdir(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
stat
.
S_ISDIR
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISDIR
(
st
.
st_mode
)
# Is a path a regular file?
...
...
@@ -230,7 +227,7 @@ def isfile(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
stat
.
S_ISREG
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISREG
(
st
.
st_mode
)
# Is a path a mount point? Either a root (with or without drive letter)
...
...
Lib/posixpath.py
Dosyayı görüntüle @
32200aea
...
...
@@ -136,18 +136,15 @@ def commonprefix(m):
def
getsize
(
filename
):
"""Return the size of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_SIZE
]
return
os
.
stat
(
filename
)
.
st_size
def
getmtime
(
filename
):
"""Return the last modification time of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_MTIME
]
return
os
.
stat
(
filename
)
.
st_mtime
def
getatime
(
filename
):
"""Return the last access time of a file, reported by os.stat()."""
st
=
os
.
stat
(
filename
)
return
st
[
stat
.
ST_ATIME
]
return
os
.
stat
(
filename
)
.
st_atime
# Is a path a symbolic link?
...
...
@@ -159,7 +156,7 @@ def islink(path):
st
=
os
.
lstat
(
path
)
except
(
os
.
error
,
AttributeError
):
return
False
return
stat
.
S_ISLNK
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISLNK
(
st
.
st_mode
)
# Does a path exist?
...
...
@@ -184,7 +181,7 @@ def isdir(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
stat
.
S_ISDIR
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISDIR
(
st
.
st_mode
)
# Is a path a regular file?
...
...
@@ -197,7 +194,7 @@ def isfile(path):
st
=
os
.
stat
(
path
)
except
os
.
error
:
return
False
return
stat
.
S_ISREG
(
st
[
stat
.
ST_MODE
]
)
return
stat
.
S_ISREG
(
st
.
st_mode
)
# Are two filenames really pointing to the same file?
...
...
@@ -224,8 +221,8 @@ def sameopenfile(fp1, fp2):
def
samestat
(
s1
,
s2
):
"""Test whether two stat buffers reference the same file"""
return
s1
[
stat
.
ST_INO
]
==
s2
[
stat
.
ST_INO
]
and
\
s1
[
stat
.
ST_DEV
]
==
s2
[
stat
.
ST_DEV
]
return
s1
.
st_ino
==
s2
.
st_ino
and
\
s1
.
st_dev
==
s2
.
st_dev
# Is a path a mount point?
...
...
@@ -238,12 +235,12 @@ def ismount(path):
s2
=
os
.
stat
(
join
(
path
,
'..'
))
except
os
.
error
:
return
False
# It doesn't exist -- so not a mount point :-)
dev1
=
s1
[
stat
.
ST_DEV
]
dev2
=
s2
[
stat
.
ST_DEV
]
dev1
=
s1
.
st_dev
dev2
=
s2
.
st_dev
if
dev1
!=
dev2
:
return
True
# path/.. on a different device as path
ino1
=
s1
[
stat
.
ST_INO
]
ino2
=
s2
[
stat
.
ST_INO
]
ino1
=
s1
.
st_ino
ino2
=
s2
.
st_ino
if
ino1
==
ino2
:
return
True
# path/.. is the same i-node as path
return
False
...
...
Lib/pstats.py
Dosyayı görüntüle @
32200aea
...
...
@@ -108,7 +108,7 @@ class Stats:
f
.
close
()
try
:
file_stats
=
os
.
stat
(
arg
)
arg
=
time
.
ctime
(
file_stats
[
8
]
)
+
" "
+
arg
arg
=
time
.
ctime
(
file_stats
.
st_mtime
)
+
" "
+
arg
except
:
# in case this is not unix
pass
self
.
files
=
[
arg
]
...
...
Lib/py_compile.py
Dosyayı görüntüle @
32200aea
...
...
@@ -46,9 +46,9 @@ def compile(file, cfile=None, dfile=None):
import
os
,
marshal
,
__builtin__
f
=
open
(
file
,
'U'
)
try
:
timestamp
=
long
(
os
.
fstat
(
f
.
fileno
())
[
8
]
)
timestamp
=
long
(
os
.
fstat
(
f
.
fileno
())
.
st_mtime
)
except
AttributeError
:
timestamp
=
long
(
os
.
stat
(
file
)
[
8
]
)
timestamp
=
long
(
os
.
stat
(
file
)
.
st_mtime
)
codestring
=
f
.
read
()
# If parsing from a string, line breaks are \n (see parsetok.c:tok_nextc)
# Replace will return original string if pattern is not found, so
...
...
Lib/pydoc.py
Dosyayı görüntüle @
32200aea
...
...
@@ -43,7 +43,7 @@ Mynd you, m
# the current directory is changed with os.chdir(), an incorrect
# path will be displayed.
import
sys
,
imp
,
os
,
stat
,
re
,
types
,
inspect
import
sys
,
imp
,
os
,
re
,
types
,
inspect
from
repr
import
Repr
from
string
import
expandtabs
,
find
,
join
,
lower
,
split
,
strip
,
rfind
,
rstrip
...
...
@@ -153,7 +153,7 @@ def ispackage(path):
def
synopsis
(
filename
,
cache
=
{}):
"""Get the one-line summary out of a module file."""
mtime
=
os
.
stat
(
filename
)
[
stat
.
ST_MTIME
]
mtime
=
os
.
stat
(
filename
)
.
st_mtime
lastupdate
,
result
=
cache
.
get
(
filename
,
(
0
,
None
))
if
lastupdate
<
mtime
:
info
=
inspect
.
getmoduleinfo
(
filename
)
...
...
@@ -1698,7 +1698,7 @@ class ModuleScanner(Scanner):
def
__init__
(
self
):
roots
=
map
(
lambda
dir
:
(
dir
,
''
),
pathdirs
())
Scanner
.
__init__
(
self
,
roots
,
self
.
submodules
,
self
.
isnewpackage
)
self
.
inodes
=
map
(
lambda
(
dir
,
pkg
):
os
.
stat
(
dir
)
[
1
]
,
roots
)
self
.
inodes
=
map
(
lambda
(
dir
,
pkg
):
os
.
stat
(
dir
)
.
st_ino
,
roots
)
def
submodules
(
self
,
(
dir
,
package
)):
children
=
[]
...
...
@@ -1712,7 +1712,7 @@ class ModuleScanner(Scanner):
return
children
def
isnewpackage
(
self
,
(
dir
,
package
)):
inode
=
os
.
path
.
exists
(
dir
)
and
os
.
stat
(
dir
)
[
1
]
inode
=
os
.
path
.
exists
(
dir
)
and
os
.
stat
(
dir
)
.
st_ino
if
not
(
os
.
path
.
islink
(
dir
)
and
inode
in
self
.
inodes
):
self
.
inodes
.
append
(
inode
)
# detect circular symbolic links
return
ispackage
(
dir
)
...
...
Lib/statcache.py
Dosyayı görüntüle @
32200aea
...
...
@@ -79,4 +79,4 @@ def isdir(path):
st
=
stat
(
path
)
except
_os
.
error
:
return
False
return
S_ISDIR
(
st
[
ST_MODE
]
)
return
S_ISDIR
(
st
.
st_mode
)
Lib/uu.py
Dosyayı görüntüle @
32200aea
...
...
@@ -52,7 +52,7 @@ def encode(in_file, out_file, name=None, mode=None):
name
=
os
.
path
.
basename
(
in_file
)
if
mode
is
None
:
try
:
mode
=
os
.
stat
(
in_file
)
[
0
]
mode
=
os
.
stat
(
in_file
)
.
st_mode
except
AttributeError
:
pass
in_file
=
open
(
in_file
,
'rb'
)
...
...
Lib/zipfile.py
Dosyayı görüntüle @
32200aea
...
...
@@ -373,7 +373,7 @@ class ZipFile:
"""Put the bytes from filename into the archive under the name
arcname."""
st
=
os
.
stat
(
filename
)
mtime
=
time
.
localtime
(
st
[
8
]
)
mtime
=
time
.
localtime
(
st
.
st_mtime
)
date_time
=
mtime
[
0
:
6
]
# Create ZipInfo instance to store file information
if
arcname
is
None
:
...
...
@@ -572,10 +572,10 @@ class PyZipFile(ZipFile):
file_pyc
=
pathname
+
".pyc"
file_pyo
=
pathname
+
".pyo"
if
os
.
path
.
isfile
(
file_pyo
)
and
\
os
.
stat
(
file_pyo
)
[
8
]
>=
os
.
stat
(
file_py
)[
8
]
:
os
.
stat
(
file_pyo
)
.
st_mtime
>=
os
.
stat
(
file_py
)
.
st_mtime
:
fname
=
file_pyo
# Use .pyo file
elif
not
os
.
path
.
isfile
(
file_pyc
)
or
\
os
.
stat
(
file_pyc
)
[
8
]
<
os
.
stat
(
file_py
)[
8
]
:
os
.
stat
(
file_pyc
)
.
st_mtime
<
os
.
stat
(
file_py
)
.
st_mtime
:
import
py_compile
if
self
.
debug
:
print
"Compiling"
,
file_py
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment