The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Thank you very much for your replies and time spent in answering my queries.
I am working on windows platform so folder cannot be renamed to a name that start with . (Dot .)
I want to hide from OS user. I mean I shouldnt be able to see that file/folder in windows if the option "Do not show hidden files/folders" is set in folders options.
As far as I know, Java doesn't provide a way to do that, as it's highly platform specific.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
File or folder cant be set to hidden from java. You have to use JNI (java native interface) to do so. I had one requirement to find the free space in a drive in windows machine and I used JNI to do so. This is another candidate for JNI.
You don't need to use JNI to do this, you can just use STring cmd[] = {"attrib","+h",filename}; Runtime.getRuntime().exec(cmd); , (assuming you only want it to ever run on windows)
Emmy, Is there any similar way to get the free space from hard drive too? Assuming that I will pass the drive letter to the function and it will return the total hard disc space & available hard disc space?