mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -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))
|
||||
return fs
|
||||
|
||||
def build_fallback(self) -> None:
|
||||
self.tab = VFS(self.log_func, "idk", "/", AXS(), {})
|
||||
self.trusted = False
|
||||
|
||||
def build_tab(self) -> None:
|
||||
self.log("building tab")
|
||||
|
||||
|
@ -128,8 +132,7 @@ class Fstab(object):
|
|||
except:
|
||||
# prisonparty or other restrictive environment
|
||||
self.log("failed to build tab:\n{}".format(min_ex()), 3)
|
||||
self.tab = VFS(self.log_func, "idk", "/", AXS(), {})
|
||||
self.trusted = False
|
||||
self.build_fallback()
|
||||
|
||||
assert self.tab
|
||||
ret = self.tab._find(path)[0]
|
||||
|
@ -143,6 +146,9 @@ class Fstab(object):
|
|||
assert ctypes
|
||||
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:
|
||||
if not rc:
|
||||
raise ctypes.WinError(ctypes.get_last_error())
|
||||
|
|
Loading…
Reference in a new issue