File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes Attributes on files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Attributes on files" Watch "Attributes on files" New topic

Attributes on files

Stefan Hedberg

Joined: Feb 13, 2004
Posts: 1
Just wondering how to get the attributes from files that we read?
Some say that java cannot read this and some say you can but they don't know how. Please help me.
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
What attributes are you looking for? The File object can tell you if it's readble or not, the size, modifed time, etc. I dno't believe it can tell you what permission is on the file etc.
Stefan G Hedberg

Joined: Feb 17, 2004
Posts: 1
well it was the permissions I wanted to get. Working on a backup that will work on all systems and that will be able to restore files as they were before the backup. To do that I need to know the permissions on the files so that information can be stored with the file in the db.
I agree. Here's the link:
subject: Attributes on files
It's not a secret anymore!