ATMEL: Change the date of a file

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# Change the date of a file
[Examples]

This example changes the creation date and last access date.

    Bool changedate( void )
    {
    // Example to modify a file date
       const U8 _MEM_TYPE_SLOW_ date_create[]="2005122512301050"; // Date = 12/25/2005 12h30mn10.5s
       const U8 _MEM_TYPE_SLOW_ date_write[]="2006072319005130";  // Date = 07/23/2006 19h51mn30s

       nav_select(0); // Select navigator ID 0 for this sequence

       if( !nav_drive_set( LUN_ID_NF_DISKMASS ))
          return FALSE;
       if( !nav_partition_mount() )
          return FALSE;
       // Select the first file or directory
       if( !nav_filelist_set( 0 , FS_FIND_NEXT ) )
          return FALSE;
       // Modify the creation date
       if( !nav_file_dateset( date_create , FS_DATE_CREATION) )
          return FALSE;
       // Modify the last access date
       if( !nav_file_dateset( date_write , FS_DATE_LAST_WRITE) )
          return FALSE;

       return TRUE;
    }