Opened 5 years ago

Closed 5 years ago

#11142 closed enhancement (fixed)

FAT: archive bit support

Reported by: MatejHorvat Owned by: nobody
Priority: normal Milestone: R1
Component: File Systems/FAT Version: R1/Development
Keywords: FAT, archive Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All


The archive bit in FAT directory entries is intended to be set automatically by the operating system when creating or modifying a file and cleared by a backup program when the file is backed up.

I have attached a patch which sets the archive bit for each directory entry when it is written. However, it does not expose it to the user to manually set or clear. This should be added as well.

Attachments (2)

Change History (7)

comment:1 by MatejHorvat, 5 years ago

Has a Patch: set

comment:2 by korli, 5 years ago

Thanks for the patch!

  • _create_dir_entry_() is also used to create a label. Setting the mode in create_dir_entry() should be preferred.
  • write_vnode_entry() is too generic: you should only add the archive bit when the modification time is updated and when the node isn't a directory here.

comment:3 by MatejHorvat, 5 years ago

New patch (not a patch to the previous patch, but a replacement for it).

Whether directories should have the archive bit set or not is debatable, because Microsoft's FAT specification says nothing about it. It could be useful to have it set in the case of an empty directory (to have it backed up), but Windows and FreeDOS don't set it, so I guess the most correct/compatible behavior is to not set it. So I have also updated dosfs_mkdir to make sure that "." and ".." don't have it.

comment:4 by axeld, 5 years ago

Thanks for your contribution! I've applied it in hrev47821, sorry for the delay.

Please note that the first line of your commit message should not exceed 64 characters, and should include the component you're working on. For example, it may have looked like this:

fat: set archive bit for new/modified files

* Sets the archive bit on newly created and updated entries, but not
  for directories.

comment:5 by axeld, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.