Post Reply 
Arduino IL Drive Sim read good write bad
11-27-2019, 08:17 AM
Post: #4
RE: Arduino IL Drive Sim read good write bad
Hello,
there was indeed an important change to the SD card library. First, FILE_WRITE had the same meaning as O_RDWR. It was O_READ and O_WRITE (and O_CREAT, which does not matter because the IL-Drive simulator never want to create a file).

As mentioned in the second link above, O_APPEND means:
/ ** The file offset shall be the end of the file prior to each write. */

At the end of the year 2017, FILE_WRITE was redefined:
https://github.com/arduino-libraries/SD/...0026216672
This means that the SD card library now jumps to the end of the file with every write command if the file was opened with the parameter FILE_WRITE. However, the IL-Drive simulator must be able to change the data within the existing file because the directory entries are stored at the beginning of the LIF file. If you want to program a Arduino Mega 2560 for the IL-Drive simulator with the current Arduino IDE, you have to replace FILE_WRITE in the file ildrive.cpp with O_RDWR at two places.

In this entry also someone describes his surprise about the changed behavior of the SD card library:
https://forum.arduino.cc/index.php?topic=636591.0

Best Regards
Klaus
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Arduino IL Drive Sim read good write bad - Klaus Overhage - 11-27-2019 08:17 AM



User(s) browsing this thread: 1 Guest(s)