nathanhi / pyfatfs

Python based FAT12/FAT16/FAT32 implementation with VFAT support
https://pypi.org/project/pyfatfs/
MIT License
31 stars 14 forks source link

Fix creating directory with name that is already conforms to 8DOT3 #5

Closed koolkdev closed 3 years ago

koolkdev commented 3 years ago

when using preserve_case, fs.makedir("TEST") fails with:

File "C:\Python37\lib\site-packages\pyfatfs\PyFatFS.py", line 291, in makedir
lfn_entry = make_lfn_entry(dirname, short_name)
File "C:\Python37\lib\site-packages\pyfatfs\FATDirectoryEntry.py", line 609, in make_lfn_entry
errno=errno.EINVAL)
pyfatfs._exceptions.PyFATException: Directory entry is already 8.3 conform, no need to create an LFN entry.

The current check for this case was already in the function create (for files). So I copied it to makedir too.

nathanhi commented 3 years ago

Thank you very much for your contribution!