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

how to set read & write atteribute of files?  RSS feed

 
kunal shah
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi every body
i have one very small problem how to set file modes i.e. atteribute READ ONLY,HIDEN & ARCHIEVE?
so plaese reply quickly
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am not aure abt setting other attributes
yes for read-only
java.io.File has setReadOnly() to do that
karthik.
 
Sameer Sawla
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U can use File class following methods to determine the attributes : isHidden(), isDirectory().
To determine weather its readonly or not u can use canWrite() method.
 
kunal shah
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi dear i dont want to see that the file is hidden or read only but i want to set a new file to hidden or set only by program.
 
kunal shah
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
even java.io.file doesnot have any method setReadonly() like so pl try it again.
 
bhuvan gupta
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JDK 1.3 java.io.file do have setReadOnly()

Originally posted by kunal shah:
even java.io.file doesnot have any method setReadonly() like so pl try it again.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!