mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
too soon
This commit is contained in:
parent
d020527c6f
commit
05a1a31cab
|
@ -381,7 +381,7 @@ def main(argv=None):
|
||||||
|
|
||||||
nstrs = []
|
nstrs = []
|
||||||
anymod = False
|
anymod = False
|
||||||
for ostr in al.v:
|
for ostr in al.v or []:
|
||||||
mod = False
|
mod = False
|
||||||
oa = ostr.split(":")
|
oa = ostr.split(":")
|
||||||
na = oa[:2]
|
na = oa[:2]
|
||||||
|
|
|
@ -10,8 +10,8 @@ from . import path
|
||||||
# printf 'os\.(%s)' "$(grep ^def bos/__init__.py | gsed -r 's/^def //;s/\(.*//' | tr '\n' '|' | gsed -r 's/.$//')"
|
# printf 'os\.(%s)' "$(grep ^def bos/__init__.py | gsed -r 's/^def //;s/\(.*//' | tr '\n' '|' | gsed -r 's/.$//')"
|
||||||
|
|
||||||
|
|
||||||
def chmod(p, mode, follow_symlinks=True):
|
def chmod(p, mode):
|
||||||
return os.chmod(fsenc(p), mode, follow_symlinks=follow_symlinks)
|
return os.chmod(fsenc(p), mode)
|
||||||
|
|
||||||
|
|
||||||
def listdir(p="."):
|
def listdir(p="."):
|
||||||
|
@ -22,8 +22,8 @@ def lstat(p):
|
||||||
return os.lstat(fsenc(p))
|
return os.lstat(fsenc(p))
|
||||||
|
|
||||||
|
|
||||||
def makedirs(name, mode=0o755, exist_ok=None):
|
def makedirs(name, mode=0o755):
|
||||||
return os.makedirs(fsenc(name), mode=mode, exist_ok=exist_ok)
|
return os.makedirs(fsenc(name), mode=mode)
|
||||||
|
|
||||||
|
|
||||||
def mkdir(p, mode=0o755):
|
def mkdir(p, mode=0o755):
|
||||||
|
@ -42,13 +42,13 @@ def rmdir(p):
|
||||||
return os.rmdir(fsenc(p))
|
return os.rmdir(fsenc(p))
|
||||||
|
|
||||||
|
|
||||||
def stat(p, follow_symlinks=True):
|
def stat(p):
|
||||||
return os.stat(fsenc(p), follow_symlinks=follow_symlinks)
|
return os.stat(fsenc(p))
|
||||||
|
|
||||||
|
|
||||||
def unlink(p):
|
def unlink(p):
|
||||||
return os.unlink(fsenc(p))
|
return os.unlink(fsenc(p))
|
||||||
|
|
||||||
|
|
||||||
def utime(p, times=None, follow_symlinks=True):
|
def utime(p, times=None):
|
||||||
return os.utime(fsenc(p), times, follow_symlinks=follow_symlinks)
|
return os.utime(fsenc(p), times)
|
||||||
|
|
|
@ -308,7 +308,7 @@ class HttpSrv(object):
|
||||||
try:
|
try:
|
||||||
with os.scandir(os.path.join(E.mod, "web")) as dh:
|
with os.scandir(os.path.join(E.mod, "web")) as dh:
|
||||||
for fh in dh:
|
for fh in dh:
|
||||||
inf = fh.stat(follow_symlinks=False)
|
inf = fh.stat()
|
||||||
v = max(v, inf.st_mtime)
|
v = max(v, inf.st_mtime)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -1283,9 +1283,7 @@ class Up2k(object):
|
||||||
ptop = vn.realpath
|
ptop = vn.realpath
|
||||||
atop = vn.canonical(rem)
|
atop = vn.canonical(rem)
|
||||||
adir, fn = os.path.split(atop)
|
adir, fn = os.path.split(atop)
|
||||||
|
st = bos.lstat(atop)
|
||||||
fun = bos.lstat if os.supports_follow_symlinks else bos.stat
|
|
||||||
st = fun(atop)
|
|
||||||
if stat.S_ISLNK(st.st_mode) or stat.S_ISREG(st.st_mode):
|
if stat.S_ISLNK(st.st_mode) or stat.S_ISREG(st.st_mode):
|
||||||
g = [[os.path.dirname(vpath), adir, [[fn, 0]], [], []]]
|
g = [[os.path.dirname(vpath), adir, [[fn, 0]], [], []]]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1034,11 +1034,11 @@ def sendfile_kern(lower, upper, f, s):
|
||||||
|
|
||||||
|
|
||||||
def statdir(logger, scandir, lstat, top):
|
def statdir(logger, scandir, lstat, top):
|
||||||
lstat = lstat and os.supports_follow_symlinks
|
|
||||||
try:
|
try:
|
||||||
btop = fsenc(top)
|
btop = fsenc(top)
|
||||||
if scandir and hasattr(os, "scandir"):
|
if scandir and hasattr(os, "scandir"):
|
||||||
src = "scandir"
|
src = "scandir"
|
||||||
|
lstat = lstat and os.supports_follow_symlinks
|
||||||
with os.scandir(btop) as dh:
|
with os.scandir(btop) as dh:
|
||||||
for fh in dh:
|
for fh in dh:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue