Please give me a simple program to hide and unhide the folder in linux.
I have used this program for windows.
Runtime.getRuntime().exec("attrib -h \""+file.getAbsolutePath()+"\"");
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Please give me a simple program to hide and unhide the folder in linux.
I have used this program for windows.
Runtime.getRuntime().exec("attrib -h \""+file.getAbsolutePath()+"\"");
Welcome to the forum.
If you want to write it yourself, someone here will usually answer questions you have, but this is not a free code service.
Oldie but goodie. Implement it according to this: When Runtime.exec() won't - JavaWorld
Linux works completely differently than Windows. To 'hide' a file, name the file beginning with a dot ('.') - the file can still be seen if the user knows how. Not sure why you wish to hide a file though...sounds a bit fishy to me.
Actually i have a tree on my UI page that containing the folder structure that is reading from file system, so i have to provide a facility to user to hide or unhide any folder from UI itself .
so for windows i have written a code like this :- Runtime.getRuntime().exec("attrib -h \""+file.getAbsolutePath()+"\"");
and this code is not working with linux , you suggest me to start with dot ('.') . so pls give me complete idea how to use the above code.
please show me one example demo .
Thanks in Advance
Ashish kumar
Why hide via the OS rather than through the UI, which would be a much more platform independent solution. But give you haven't provided any information as to what sort of 'UI' or 'tree', we can only guess as to any recommendationsActually i have a tree on my UI page that containing the folder structure that is reading from file system, so i have to provide a facility to user to hide or unhide any folder from UI itself .
You first. Please read post #2so pls give me complete idea how to use the above code.
please show me one example demo .