开发者

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

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......


As already mentioned by Jed, you can use attrib both to query and to set the archive bit. You must however remember to use the cygpath tool to convert between cygwin style file names and DOS style names, as required by attrib.

If you convert the output of find with cygpath, invoke attrib for each file name and use egrep to check for lines starting with A (regexp '^A'), you should be able to search for files with the archive bit set.


When I used cygwin, I made sure it had access to the Windows tools as well. In that case, you can use attrib to at least set or clear the archive bit for you.

To list files with the archive bit set you can use dir /A:A, which you can accomplish by doing CMD /c or something similar.

I don't think you're going to find the ability to do this in Unix tools.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜