Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
0cc61670
Commit
0cc61670
authored
Aug 09, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow setting volume and filesystem label in mount() kwd args
parent
1654f265
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
fs/expose/dokan/__init__.py
+6
-4
No files found.
fs/expose/dokan/__init__.py
View file @
0cc61670
...
@@ -173,9 +173,11 @@ MIN_FH = 100
...
@@ -173,9 +173,11 @@ MIN_FH = 100
class
FSOperations
(
DokanOperations
):
class
FSOperations
(
DokanOperations
):
"""DokanOperations interface delegating all activities to an FS object."""
"""DokanOperations interface delegating all activities to an FS object."""
def
__init__
(
self
,
fs
,
on_init
=
None
,
on_unmount
=
None
):
def
__init__
(
self
,
fs
,
on_init
=
None
,
on_unmount
=
None
,
fsname
=
"Dokan FS"
,
volname
=
"Dokan Volume"
):
super
(
FSOperations
,
self
)
.
__init__
()
super
(
FSOperations
,
self
)
.
__init__
()
self
.
fs
=
fs
self
.
fs
=
fs
self
.
fsname
=
fsname
self
.
volname
=
volname
self
.
_on_init
=
on_init
self
.
_on_init
=
on_init
self
.
_on_unmount
=
on_unmount
self
.
_on_unmount
=
on_unmount
self
.
_files_by_handle
=
{}
self
.
_files_by_handle
=
{}
...
@@ -510,7 +512,7 @@ class FSOperations(DokanOperations):
...
@@ -510,7 +512,7 @@ class FSOperations(DokanOperations):
@handle_fs_errors
@handle_fs_errors
def
GetVolumeInformation
(
self
,
vnmBuf
,
vnmSz
,
sNum
,
maxLen
,
flags
,
fnmBuf
,
fnmSz
,
info
):
def
GetVolumeInformation
(
self
,
vnmBuf
,
vnmSz
,
sNum
,
maxLen
,
flags
,
fnmBuf
,
fnmSz
,
info
):
nm
=
ctypes
.
create_unicode_buffer
(
"Dokan Volume"
[:
vnmSz
-
1
])
nm
=
ctypes
.
create_unicode_buffer
(
self
.
volname
[:
vnmSz
-
1
])
sz
=
(
len
(
nm
.
value
)
+
1
)
*
ctypes
.
sizeof
(
ctypes
.
c_wchar
)
sz
=
(
len
(
nm
.
value
)
+
1
)
*
ctypes
.
sizeof
(
ctypes
.
c_wchar
)
ctypes
.
memmove
(
vnmBuf
,
nm
,
sz
)
ctypes
.
memmove
(
vnmBuf
,
nm
,
sz
)
if
sNum
:
if
sNum
:
...
@@ -519,7 +521,7 @@ class FSOperations(DokanOperations):
...
@@ -519,7 +521,7 @@ class FSOperations(DokanOperations):
maxLen
[
0
]
=
255
maxLen
[
0
]
=
255
if
flags
:
if
flags
:
flags
[
0
]
=
0
flags
[
0
]
=
0
nm
=
ctypes
.
create_unicode_buffer
(
"Dokan FS"
[:
fnmSz
-
1
])
nm
=
ctypes
.
create_unicode_buffer
(
self
.
fsname
[:
fnmSz
-
1
])
sz
=
(
len
(
nm
.
value
)
+
1
)
*
ctypes
.
sizeof
(
ctypes
.
c_wchar
)
sz
=
(
len
(
nm
.
value
)
+
1
)
*
ctypes
.
sizeof
(
ctypes
.
c_wchar
)
ctypes
.
memmove
(
fnmBuf
,
nm
,
sz
)
ctypes
.
memmove
(
fnmBuf
,
nm
,
sz
)
...
@@ -679,7 +681,7 @@ def mount(fs, drive, foreground=False, ready_callback=None, unmount_callback=Non
...
@@ -679,7 +681,7 @@ def mount(fs, drive, foreground=False, ready_callback=None, unmount_callback=Non
flags
=
kwds
.
pop
(
"flags"
,
0
)
flags
=
kwds
.
pop
(
"flags"
,
0
)
FSOperationsClass
=
kwds
.
pop
(
"FSOperationsClass"
,
FSOperations
)
FSOperationsClass
=
kwds
.
pop
(
"FSOperationsClass"
,
FSOperations
)
opts
=
libdokan
.
DOKAN_OPTIONS
(
drive
[:
1
],
numthreads
,
flags
)
opts
=
libdokan
.
DOKAN_OPTIONS
(
drive
[:
1
],
numthreads
,
flags
)
ops
=
FSOperationsClass
(
fs
,
on_unmount
=
unmount_callback
)
ops
=
FSOperationsClass
(
fs
,
on_unmount
=
unmount_callback
,
**
kwds
)
if
ready_callback
:
if
ready_callback
:
check_thread
=
threading
.
Thread
(
target
=
check_ready
)
check_thread
=
threading
.
Thread
(
target
=
check_ready
)
check_thread
.
daemon
=
True
check_thread
.
daemon
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment