mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
cache sparsefile-support on windows too
This commit is contained in:
parent
de7dd1e60a
commit
75cdf17df4
|
@ -71,6 +71,10 @@ class Fstab(object):
|
||||||
self.log("found {} at {}".format(fs, path))
|
self.log("found {} at {}".format(fs, path))
|
||||||
return fs
|
return fs
|
||||||
|
|
||||||
|
def build_fallback(self) -> None:
|
||||||
|
self.tab = VFS(self.log_func, "idk", "/", AXS(), {})
|
||||||
|
self.trusted = False
|
||||||
|
|
||||||
def build_tab(self) -> None:
|
def build_tab(self) -> None:
|
||||||
self.log("building tab")
|
self.log("building tab")
|
||||||
|
|
||||||
|
@ -128,8 +132,7 @@ class Fstab(object):
|
||||||
except:
|
except:
|
||||||
# prisonparty or other restrictive environment
|
# prisonparty or other restrictive environment
|
||||||
self.log("failed to build tab:\n{}".format(min_ex()), 3)
|
self.log("failed to build tab:\n{}".format(min_ex()), 3)
|
||||||
self.tab = VFS(self.log_func, "idk", "/", AXS(), {})
|
self.build_fallback()
|
||||||
self.trusted = False
|
|
||||||
|
|
||||||
assert self.tab
|
assert self.tab
|
||||||
ret = self.tab._find(path)[0]
|
ret = self.tab._find(path)[0]
|
||||||
|
@ -143,6 +146,9 @@ class Fstab(object):
|
||||||
assert ctypes
|
assert ctypes
|
||||||
from ctypes.wintypes import BOOL, DWORD, LPCWSTR, LPDWORD, LPWSTR, MAX_PATH
|
from ctypes.wintypes import BOOL, DWORD, LPCWSTR, LPDWORD, LPWSTR, MAX_PATH
|
||||||
|
|
||||||
|
if not self.tab:
|
||||||
|
self.build_fallback()
|
||||||
|
|
||||||
def echk(rc: int, fun: Any, args: Any) -> None:
|
def echk(rc: int, fun: Any, args: Any) -> None:
|
||||||
if not rc:
|
if not rc:
|
||||||
raise ctypes.WinError(ctypes.get_last_error())
|
raise ctypes.WinError(ctypes.get_last_error())
|
||||||
|
|
Loading…
Reference in a new issue