|
61 | 61 | # Copyright (c) 2016-2016, Adrien J. <liryna.stark@gmail.com>. |
62 | 62 | # All rights reserved; available under the terms of the MIT License. |
63 | 63 |
|
64 | | -from __future__ import with_statement |
| 64 | +from __future__ import with_statement, absolute_import |
65 | 65 |
|
66 | 66 | import six |
67 | 67 | import sys |
|
86 | 86 | from fs.wrapfs import WrapFS |
87 | 87 |
|
88 | 88 | try: |
89 | | - if six.PY2: import libdokan |
90 | | - elif six.PY3: from . import libdokan |
91 | | - else: raise |
| 89 | + from . import libdokan |
92 | 90 | except (NotImplementedError, EnvironmentError, ImportError, NameError,): |
93 | 91 | is_available = False |
94 | 92 | sys.modules.pop("fs.expose.dokan.libdokan", None) |
@@ -311,13 +309,14 @@ def wrapper(self, *args): |
311 | 309 | class FSOperations(object): |
312 | 310 | """Object delegating all DOKAN_OPERATIONS pointers to an FS object.""" |
313 | 311 |
|
314 | | - def __init__(self, fs, fsname="NTFS", volname="Dokan Volume"): |
| 312 | + def __init__(self, fs, fsname="NTFS", volname="Dokan Volume", securityfolder=os.path.expanduser('~')): |
315 | 313 | if libdokan is None: |
316 | 314 | msg = 'dokan library (http://dokan-dev.github.io/) is not available' |
317 | 315 | raise OSError(msg) |
318 | 316 | self.fs = fs |
319 | 317 | self.fsname = fsname |
320 | 318 | self.volname = volname |
| 319 | + self.securityfolder = securityfolder |
321 | 320 | self._files_by_handle = {} |
322 | 321 | self._files_lock = threading.Lock() |
323 | 322 | self._next_handle = MIN_FH |
@@ -816,7 +815,7 @@ def GetFileSecurity(self, path, securityinformation, securitydescriptor, securit |
816 | 815 | path = self._dokanpath2pyfs(path) |
817 | 816 | if self.fs.isdir(path): |
818 | 817 | res = libdokan.GetFileSecurity( |
819 | | - os.path.expanduser('~'), |
| 818 | + self.securityfolder, |
820 | 819 | ctypes.cast(securityinformation, libdokan.PSECURITY_INFORMATION)[0], |
821 | 820 | securitydescriptor, |
822 | 821 | securitydescriptorlength, |
|
0 commit comments