KurtE
Senior Member+
Morning all (or time in your part of the world),
Starting to play with MTP again...
First off: Integration question, probably for @PaulStoffregen.
In an SdFat-beta project issue conversation with Bill about supporting the changes above, he verified that the dates and times for files for the SDFat stuff is already defined and is actually in our SDFat library in the build...
So question is, should some of this be peculated up into the FS File class? Personally I think it should as again I would see cases where files change over MTP (or elsewhere) and if I were using things like configuration files, I might want to know the file changed...
Starting to play with MTP again...
First off: Integration question, probably for @PaulStoffregen.
In an SdFat-beta project issue conversation with Bill about supporting the changes above, he verified that the dates and times for files for the SDFat stuff is already defined and is actually in our SDFat library in the build...
Code:
/** Get a file's access date and time.
*
* \param[out] pdate Packed date for directory entry.
* \param[out] ptime Packed time for directory entry.
*
* \return true for success or false for failure.
*/
bool getAccessDateTime(uint16_t* pdate, uint16_t* ptime);
/** Get a file's create date and time.
*
* \param[out] pdate Packed date for directory entry.
* \param[out] ptime Packed time for directory entry.
*
* \return true for success or false for failure.
*/
bool getCreateDateTime(uint16_t* pdate, uint16_t* ptime);
/** Get a file's Modify date and time.
*
* \param[out] pdate Packed date for directory entry.
* \param[out] ptime Packed time for directory entry.
*
* \return true for success or false for failure.
*/
bool getModifyDateTime(uint16_t* pdate, uint16_t* ptime);
/** Set a file's timestamps in its directory entry.
*
* \param[in] flags Values for \a flags are constructed by a bitwise-inclusive
* OR of flags from the following list
*
* T_ACCESS - Set the file's last access date and time.
*
* T_CREATE - Set the file's creation date and time.
*
* T_WRITE - Set the file's last write/modification date and time.
*
* \param[in] year Valid range 1980 - 2107 inclusive.
*
* \param[in] month Valid range 1 - 12 inclusive.
*
* \param[in] day Valid range 1 - 31 inclusive.
*
* \param[in] hour Valid range 0 - 23 inclusive.
*
* \param[in] minute Valid range 0 - 59 inclusive.
*
* \param[in] second Valid range 0 - 59 inclusive
*
* \note It is possible to set an invalid date since there is no check for
* the number of days in a month.
*
* \note
* Modify and access timestamps may be overwritten if a date time callback
* function has been set by dateTimeCallback().
*
* \return true for success or false for failure.
*/
bool timestamp(uint8_t flags, uint16_t year, uint8_t month, uint8_t day,
uint8_t hour, uint8_t minute, uint8_t second);
So question is, should some of this be peculated up into the FS File class? Personally I think it should as again I would see cases where files change over MTP (or elsewhere) and if I were using things like configuration files, I might want to know the file changed...