logo elektroda
logo elektroda
X
logo elektroda

Arduino IDE ESP8266 SD.h - WRITE, READ, APPEND file opening modes - unclear operation

zbynio_k 84 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21648743
    zbynio_k
    Level 10  
    Hello,
    patient - Arduino IDE, esp8266, SD card, SD.h library, operations on (text) file
    Can someone explain this behaviour of the library to me?
    1. opening a file in WRITE mode adds a line to the file, not WRITE
    2. same as when opening { FILE_WRITE | O_APPEND }
    3. after opening a WRITE file, performing the operation and closing the file - dataFile.close();
    attempt to reopen ends with an error
    4. after opening the WRITE file, both data can be written and read
    Syntax - File dataFile = SD.open(file1, FILE_WRITE);

    every "normal" library (e.g. in Delphi)
    distinguishes between WRITE, READ and APPEND file opening modes

    Am I making a mental error, or does this library just work like that?
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #3 21648778
    zbynio_k
    Level 10  
    Thank you,
    after a cursory review
    I am not using SD.h, but some Fat or PetiteFat from the FS.h library
ADVERTISEMENT