Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Attributes on files  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
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.
 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!