Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Archive bit  RSS feed

 
Grant Crofton
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possibe to read / set the 'archive' attribute of a file? The File class lets you do all the other attributes. Or is this only a Windows thing, and therefore not supported - and if this is the case, is there any way round it?
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Java IO by O'Reilly:
Java allows you to test a fairly broad section of possible file attributes but, doen't allow easy access to platform specific attributes like Mac file types and creator codes, Windows archive attribute and Unix group IDs.
If you wish to chane the attribute, you could Runtime.exec() the attrib command. However, I don't know of an easy way to read this attribute from java.
 
Grant Crofton
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!