PyFilesystem / pyfilesystem

Python filesystem abstraction layer
http://pyfilesystem.org/
BSD 3-Clause "New" or "Revised" License
287 stars 63 forks source link

Why does the size of mounted disk always fixed? #276

Closed Pagliacii closed 6 years ago

Pagliacii commented 6 years ago

@Liryna Why does the size of mounted disk always like 100GB/200GB? How could I change the size?

>>> from fs.memoryfs import MemoryFS
>>> from fs.expose import dokan
>>> memfs = MemoryFS()
>>> dokan.mount(memfs, "Z:\\")
<fs.expose.dokan.MountProcess object at 0x0000000006A82FD0>

image

Liryna commented 6 years ago

@Pagliacii this is handle by GetDiskFreeSpace. Seems like it use the free_space total_space meta data. https://github.com/PyFilesystem/pyfilesystem/blob/master/fs/expose/dokan/__init__.py#L743-L751

Pagliacii commented 6 years ago

@Liryna It doesn't work. image image

Liryna commented 6 years ago

can you add logs in GetDiskFreeSpace to see if it is called and set the correct values ?

Pagliacii commented 6 years ago

Well, when I set the foreground to True, its size was changed. Thanks for your help, @Liryna :smile:

image image

Liryna commented 6 years ago

@Pagliacii this is strange you need to set this variable 😮 Probably the options are not correctly forward when the option is not enabled https://github.com/PyFilesystem/pyfilesystem/blob/master/fs/expose/dokan/__init__.py#L1017