From: Daira Hopwood Date: Tue, 27 Oct 2015 21:39:05 +0000 (+0000) Subject: Strip any long path marker in the input to flush_volume. X-Git-Url: https://git.rkrishnan.org/uri/%22doc.html/frontends/FTP-and-SFTP.rst?a=commitdiff_plain;h=26bea9a64d06abe214b49168e0bc6283c771804f;p=tahoe-lafs%2Ftahoe-lafs.git Strip any long path marker in the input to flush_volume. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/util/fileutil.py b/src/allmydata/util/fileutil.py index 857d3ebc..1d059fcc 100644 --- a/src/allmydata/util/fileutil.py +++ b/src/allmydata/util/fileutil.py @@ -546,8 +546,12 @@ if sys.platform == "win32": # def flush_volume(path): - drive = os.path.splitdrive(os.path.realpath(path))[0] + abspath = os.path.realpath(path) + if abspath.startswith("\\\\?\\"): + abspath = abspath[4 :] + drive = os.path.splitdrive(abspath)[0] + print "flushing %r" % (drive,) hVolume = CreateFileW(u"\\\\.\\" + drive, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,