How do I set/clear the Windows archive bit with cygwin’s find/chmod?

1

Yes, I know, the archive bit is evil.

That being said, is there support for querying it with 'find', and modifying it with 'chmod'?

My googling has turned up nothing......

Eric H.

Posted 2009-11-09T16:50:18.093

Reputation: 133

actually it's not. the evil bit is evil: http://www.faqs.org/rfcs/rfc3514.html

– quack quixote – 2009-11-09T18:02:45.810

Answers

2

I'd use find + attrib:

$ find . -option whatever -exec attrib -A {} \;

attrib is the old DOS command for setting & clearing those attributes. This works for me on WinXP Pro SP2; no idea if attrib is still available on Vista/Win-7.

quack quixote

Posted 2009-11-09T16:50:18.093

Reputation: 37 382

1

I don't have a solution that will work in all situations, however, on NTFS file systems, first edit your CYGWIN environment variable, adding ntsec. On NTFS you can then use chmod to manage file permissions. This variable is typically set in /../cygwin/cygnus.bat. When setting CYGWIN, separate each option with a space.

I'll try to figure out a working example cmd line...

DaveParillo

Posted 2009-11-09T16:50:18.093

Reputation: 13 402