Okay, I think Iβm coming, look at this solution! :)
private var CheckDelay:Timer = new Timer(5000, 0); private function InitApp():void { CheckDelay.addEventListener(TimerEvent.Timer, CheckForNewFiles, false, 0, true); CheckDelay.start(); } private function CheckForNewFiles(event:TimerEvent):void { var FS:FileStream = new FileStream(); var Buffer:File = File.applicationStorageDirectory.resolvePath("FilesBuffer.cmd"); FS.open(Buffer, FileMode.Write); FS.writeUTFBytes("cd " + File.desktopDirectory.nativePath + "\r\n" + "dir /on /b > " + File.applicationStorageDirectory.resolvePath("FileList.txt").nativePath); FS.close(); var Process:NativeProcess = new NativeProcess(); var NPI:NativeProcessStartupInfo = NativeProcessStartupInfo();
At the end, we got an Array (TempArray), which we could use on a datagrid (for example) with the following types: "extension, File Name, FilePath, etc."
Files are updated every 5 seconds.
And why do we use all this code instead of the simple "File.getDirectoryListing ()"? Since we update our application every 5 seconds, if getDirectoryListing () is used for what, our application will take up much more RAM, as well as the cmd command much faster ... :)
If you have an idea, please share it with us! Thanks !: D
source share