SD Library - create file with attribute DIR_ATTR_ARCHIVE 0x20

Status
Not open for further replies.

aiw

Member
I'm using the uTasker SD bootloader for a teensy 3.5 so that I can send remote updates via cellular XBee and then send the file over serial to write to SD Card. The SD card bootloader expects the files to have the attribute DIR_ATTR_ARCHIVE 0x20, but the SD Library writes x00 in this location.

Windows file creation:
0x204e4942

SD Library creation:
0x004e4942

Is there a way to open/create a file with that attribute set?
 
I do see that the library has the attribute. Just not sure how to force it to be used.

https://github.com/arduino-libraries/SD/blob/master/src/utility/FatStructs.h

Code:
/** file is read-only */
uint8_t const DIR_ATT_READ_ONLY = 0X01;
/** File should hidden in directory listings */
uint8_t const DIR_ATT_HIDDEN = 0X02;
/** Entry is for a system file */
uint8_t const DIR_ATT_SYSTEM = 0X04;
/** Directory entry contains the volume label */
uint8_t const DIR_ATT_VOLUME_ID = 0X08;
/** Entry is for a directory */
uint8_t const DIR_ATT_DIRECTORY = 0X10;
/** Old DOS archive bit for backup support */
uint8_t const DIR_ATT_ARCHIVE = 0X20;
 
Sorry, I am probably not much help here. I don't see anywhere that the attributes are exported that way or ways to control it.
But I am looking at it more from using it with other things like MTP and/or MSC type stuff ... Different threads.

You might have better luck looking up at places like: https://github.com/greiman/SdFat
Note: With the current Beta of Teensyduino the SD code is now a thing wrapper to SDFat code base.
Which is based on: https://github.com/greiman/SdFat-beta
 
I made a fork of SdFat-beta last year and added in makeSystem(), makeHidden(), makeReadOnly() and makeArchive() methods, as well as code in the sync() method (which is called when the file is closed) to set any changed bits. You might be able to use it as inspiration.
 
Status
Not open for further replies.
Back
Top