Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

help required regerding making hidden file

  Asked By: Erica    Date: Sep 21    Category: Java    Views: 1088

there is a problem regarding file making.
i want to create a file using JAVA code with property 'hidden' or 'hide'
in java there is method to make file read only but no method to make file hidden. there is only one method isHidden() which only tells whether file is hidden or not. please tell us is there any method to make hidden file.



3 Answers Found

Answer #1    Answered By: Hariz Burki     Answered On: Sep 21

This is a way to create  a hidden  file but not a method.

Answer #2    Answered By: Bien Nguyen     Answered On: Sep 21

Check your "os.name" environment variable. If it contains windows, invoke
attrib.exe to set Hidden/System. Sth. like this:

Runtime.getRuntime().exec("attrib.exe +HS " + file);

And, maybe you'll need to look at "More Java Pitfalls" on how to be sure,
an exec will execute in BillOS

Answer #3    Answered By: Freddie Evans     Answered On: Sep 21
Didn't find what you were looking for? Find more on help required regerding making hidden file Or get search suggestion and latest updates.