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()+"\"");
Printable View
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 recommendationsQuote:
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 .
You first. Please read post #2Quote:
so pls give me complete idea how to use the above code.
please show me one example demo .