Closed dcoshea closed 2 years ago
Fixed on master, will be part of the upcoming bugfix release.
Thanks! I verified that the issue I was having has gone away in v1.0.5 and I was able to revert my workaround of removing the file before calling writetext()
.
With pyfatfs checked out from the bugfix/dentry_ordering branch as at 96ae6bc, with an MS-DOS 5 floppy image (probably the filesystem contents don't matter though), if I create a file and then overwrite it with less data, the old content remains at the end of the file:
This test passes with
fs.memoryfs.MemoryFS
.I assume that any case where a file is opened for write but not for append can trigger this bug.
I suspect that
pyfatfs.FatIO.FatIO.__init__()
needs to calltruncate()
whenself.mode.truncate
isTrue
likefs.memoryfs.MemoryFile.__init__()
does.