mirror of
				https://github.com/9001/copyparty.git
				synced 2025-11-03 13:33:13 +00:00 
			
		
		
		
	cache sparsefile-support on windows too
This commit is contained in:
		@@ -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())
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user