avsa242 / sdfat-spin

FAT-fs on SD implementation for the P8X32A/Propeller, P2X8C4M64P/Propeller 2
Other
0 stars 0 forks source link

fopen() doesn't allocate a cluster when creating a new file #34

Closed avsa242 closed 6 months ago

avsa242 commented 6 months ago

This must've broken in one of the updates this weekend.

avsa242 commented 6 months ago

As (re)written, _fmode hasn't yet been set when alloc_clust() is called, so it thinks the file wasn't opened with the right mode bits set. Putting the _fmode assignment right before the call to alloc_clust() fixes it.