natevw / fatfs

Standalone FAT16/FAT32 filesystem implementation in JavaScript
47 stars 13 forks source link

Fix segment/offset calculation. Fix writes that span multiple segments. #24

Closed briangreenery closed 7 years ago

briangreenery commented 8 years ago

Thanks for creating this library!

I noticed a problem that not all of the files that I wrote would appear on the floppy drive when I would attach it to a Windows XP virtual machine. When I started debugging this, it looked like if the directory entry write started exactly on a segment, or if a directory entry spanned multiple segments and didn't start at offset 0, then not all of the data would be written.

It looked like this was caused by:

natevw commented 7 years ago

Very belated thanks for this patch, I'm reviewing more thoroughly now but in my initial skim looks like the right stuff!

natevw commented 7 years ago

Published as fatfs@0.10.5, thanks again!