diff --git a/lib/fs/fat32.c b/lib/fs/fat32.c index f906436..fc5f78b 100644 --- a/lib/fs/fat32.c +++ b/lib/fs/fat32.c @@ -1353,7 +1353,7 @@ static errval_t _fat32_fcreate(struct fat32 *fat32, const char *path, struct fat // store the directory in the space in the parent directory we found assert(free_cluster_number > 1); struct fat32_directory_entry directory_entry = { - .attributes = 0, + .attributes = FAT32_ATTR_ARCHIVE, // mark the file for backup utilities .first_cluster_number_low_word = fat32_cluster_number_low_word(free_cluster_number), .first_cluster_number_high_word = fat32_cluster_number_high_word(free_cluster_number), .file_size = 0, @@ -1593,6 +1593,10 @@ static errval_t _fat32_fwrite(struct fat32 *fat32, struct fat32_handle *file_han fat32_get_time_information(&write_date, &write_time); directory_entry.write_date = write_date; directory_entry.write_time = write_time; + + // set the archive flag + directory_entry.attributes |= FAT32_ATTR_ARCHIVE; + errval_t dir_update_err = fat32_write_directory_entry( fat32, file_handle->directory_entry_ref,