joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.82k stars 383 forks source link

Improve DOS file attribute emulation #301

Open joncampbell123 opened 7 years ago

joncampbell123 commented 7 years ago

Currently, file attributes are faked on directory listing and ignored when DOS programs attempt to set them.

What would be better is if setting attributes were faked so that DOS programs who rely on it can work.

Some ideas:

darkstar commented 7 years ago

If you strip the leading dot from hidden files, how do you make sure that they don't clash with another, already existing file of the same name?

Also, DOS attributes can be stored in Extended Attributes (xattr) in Linux. Samba already does it that way, see here for the interface description. Maybe worth doing it the same way, with a fallback to a (hidden) file in that directory in case xattrs are not supported.

joncampbell123 commented 7 years ago

You have a point there. However the leading dot scheme would be portable across multiple filesystems and OSes at least. I'm cool with the Linux xattr idea, as long as people understand that most archival tools generally won't store xattrs when they ZIP or TAR it up and that the xattrs are specific to Linux/Samba.

The last option might be doable for someone who needs the file attributes to persist in a manner that is portable between OSes and filesystems.

forthrin commented 6 years ago

@joncampbell123: I get thousands of these when using a niche Norton Commander-type file manager. I don't know why the utility sets file attribute. I think it simple rewrites the file, and doesn't depend on the attributes at all. Is there an config file option to suppress the warning? PS! I suppose xattr would work on macOS too, though I don't know how similar it is to Linux xattr.

joncampbell123 commented 6 years ago

@forthrin I think it would be better for now if I were to mark the warning as debug message instead, so it would only show up for people like myself who use debug level, but not to concerned users.

forthrin commented 6 years ago

@joncampbell123: Agreed.

Torinde commented 1 year ago

Extended attributes implementation at dosbox-staging/dosbox-staging/pull/2693

johnnovak commented 1 year ago

Extended attributes implementation at dosbox-staging/dosbox-staging/pull/2693

Nice one, @Torinde. Ideally, this would be standardised across DOSBox variants.