Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Archive Attribute

Status
Not open for further replies.

Otacustes

IS-IT--Management
Apr 15, 2005
40
GB
Hi all

Does anyone know how to access the archive attribute for a file? I am writing a backup script with jbuilder (jdk 1.3) which requires setting and reading of the file archive attribute but I cannot find any information on how to achieve this.


All help is greatly appreciated
Kind regards
Ota
 
Sorry, but that is not possible in Java. You can only make a file readonly (there is no way to undo this) or set the last modication timestamp.
 
A not so elegant way would be, to call runtime:
Runtime.getRuntime ().exec (new String [] {"dir", "some flag", "C:/CONFIG.SYS"});
and read the output of that command.

I don't know, whether "dir" is a shell-buildin - then you would need to call ("cmd", "/c", "dir", "...") or something like that.
Else, you have to give the whole path "c:/WINDOWS/system32/dir.exe" or something.

Maybe instead of dir, it is attrib - is it?
Left dos/windos long ago...

don't visit my homepage:
 
Thanks stefanwagner you’re an absolute star.

Thanks for your help


All help is greatly appreciated
Kind regards
Ota
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top