View Full Version : Hiding a directory

01-20-2009, 10:33 AM
I am developing an AIR application on FlexBuilder 3 with the latest Gumbo SDK installed.
One of my functions searches for the HDD with the most available space on the users system and creates a working directory there.private function createTempDir():void {
// get Root Dirs
var rootDirs:Array = File.getRootDirectories();
var tempDir:Object = new Object();
tempDir.path = rootDirs[0].nativePath;
tempDir.space = rootDirs[0].spaceAvailable;

for ( var i:uint = 1; i < rootDirs.length; i++ ) {
if ( rootDirs[i].spaceAvailable > tempDir.space ) {
tempDir.path = rootDirs[i].nativePath;
tempDir.space = rootDirs[i].spaceAvailable;

var td:File = new File();
td = td.resolvePath(tempDir.path + "OrderData" + File.separator + "Test.txt");
}I want to hide the working directory, so a user cannot easily mess with it.

Any ideas how to set the directory's attribute to "hidden" or even "hidden" and "system"?


01-20-2009, 12:23 PM
Not sure if this helps, but, on Windows you can try this:
@echo off
attrib +H +S <file path> /D /S
from the bat file.

01-20-2009, 06:26 PM
Thanks alot for your reply.

I do not want to use OS specific code because the application has to run under Win, Mac and Linux.

Some ideas how it could be done within the Flex3 + Gumbo SDK / AIR 1.5 framework?


01-20-2009, 08:42 PM
As far as I know on Mac and XX it should look the same (or nearly the same)... should be chmod [keys] [files], don't know for sure. And I'm 99% sure you cannot do it using AIR only tools...