View Full Version : How to create a directory with hidden attribute
sanjayshelke
11th November 2009, 06:29
Hi,
I am facing very small issue with creating directory with hidden attribute.
How to create a directory with hidden attribute. Strangely i could not found anything like this.
regards,
~Sanjay
yogeshgokul
11th November 2009, 07:05
I am facing very small issue with creating directory with hidden attribute.How to create a directory with hidden attribute. Strangely i could not found anything like this
There is not a platform independant way to do that.
On linux you can easily achieve it by calling :
QDir dir;
dir.mkdir(".I_AM_HIDDEN");//Dot in starting of name
And for windows click here (http://msdn.microsoft.com/en-us/library/aa365535(VS.85).aspx).
sanjayshelke
11th November 2009, 07:45
Thanks a lot for this information.
I was thinking that there must be some way to do that using Qt ( without using platform dependant code ).
How about the Mac OS X?
yogeshgokul
11th November 2009, 09:37
THow about the Mac OS X?
Its also UNIX based so ideally "dot before name" method should work.
squidge
11th November 2009, 10:39
I was thinking that there must be some way to do that using Qt ( without using platform dependant code ).Qt has "setPermissions" but these don't include hidden attribute as only Windows has that function. Therefore you need to create a directory with a name starting with a '.' and then if on Windows you need to use windows-specific code to make that directory hidden. Some platforms may not support directories starting with a '.' (some smartphones).
There is no platform independant way of doing this.
sanjayshelke
12th November 2009, 06:21
Thanks a lot.
Yes finally i implemented the platform specific code for windows and Mac os x.
Mac OS X is unix based so putting '.' in front of the file makes the file hidden.
Thanks again.
migel
8th November 2012, 13:09
Can you share ?
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.