fopen() append mode?

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
treverwagenhals
Senior User
Posts: 21
Joined: Thu 2018-03-01 15:45

fopen() append mode?

Post by treverwagenhals » Mon 2018-06-25 15:48

Good day,

I saw that a few years back there was a discussion about appending to files not being supported. I was wondering if support has been implemented for that feature? From what I can see, using the "a" notation does not work correctly. Otherwise, I will just apply the copy and re-write method suggested.

Thanks

User avatar
Panu
VLSI Staff
Posts: 2572
Joined: Tue 2010-06-22 13:43

Re: fopen() append mode?

Post by Panu » Mon 2018-06-25 19:21

Hi!

Hey, that's a good question. The "a" notation probably doesn't work, but as far as I know, seeks in writable files are working now, so the append mode might not be so far away as it once was. I've totally forgotten that one.

And yes, the copy and rewrite method of course works.

I wonder what would happen if one would just open a file in "rb" mode, set the WRITABLE bit to "1" in f->flags and start seeking and shooting around. Hmm, perhaps FatFileInfo fi->currentFragment.sizeBytes should be adjusted up to the real fragment boundary first. Perhaps.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Post Reply