Posted by Extreme Ali in SWF Studio V3 on Jul 29 2008, 06:28 pm

Hi,
im new in SWF Studio. I want to know the way to get list of any Folder's all Sub Folders with path, i can do it with .bat but i dont want to use it with SWF Studio,
so which command give me required result ? i tried folderlist but it give result only for root folders.
and sorry for my english :)
Thanks in advance.


Posted by northcode in SWF Studio V3 on Jul 29 2008, 07:39 pm

The ssCore.FileSys.findFiles function is the one you're looking for.

This example will return a list of all *.txt files in the folder where your app is started and will include all subfolders as well. The list you get back will have the full path to each file (they will be short 8.3 paths).


ssCore.init();
ssDefaults.synchronousCommands = true;
var r= ssCore.FileSys.findFiles({path:"startdir://", subfolders:true, filter:"*.txt"});
ssDebug.trace(r.result);
NOTE: I'm running this synchronously, but if you have a lot of files and folders to look through, you might want to do this asynchronously to avoid frrezing your app while it looks for files.


Posted by Extreme Ali in SWF Studio V3 on Jul 30 2008, 06:40 am

Yo ! :) this command is working great but its only work for files not for folders ?
is there any other syntax for getting Folders Only ?


Posted by Clovis in SWF Studio V3 on Jul 30 2008, 10:35 am

I got a question about the filter parameter. Do multiple filters work like "*.txt|*.doc|*.rtf" ?


Posted by northcode in SWF Studio V3 on Jul 30 2008, 10:53 am


QUOTE:
is there any other syntax for getting Folders Only ?FileSys.dirList is the only option right now, but it doesn't handle subfolders, you would have to handle that yourself by calling dirList for each of the folders in the folder you're interested in (recursive function). The reason we didn't do that in the first place is that it can take a long time to complete. We updated the file list functions but never updated the directory list functions. We'll update the Filesys.dirList function to make that an option. If you send an email to support@northcode.com and mention this thread we'll send you a copy as soon as that's done so you don't have to wait for us to release the next build of SWF Studio.

QUOTE:
I got a question about the filter parameter. Do multiple filters work like "*.txt|*.doc|*.rtf" ?No. The FindFirstFile/FindNextFile API functions allow wildcard matching but not regular expressions or matching against multiple files. We could do that, but then then we'd basically be setting the wildcard to *.* and doing manual comparisons against the wildcards your supplied. It's not hard, it's just not very efficient.


Posted by Extreme Ali in SWF Studio V3 on Jul 30 2008, 11:23 am

My need is get all folders from any drive and store them anywhere like a Syslist Tree View, SO rite now i cant get all folders. OK lets See what will happen in Next Build for that time i will use .bat file :cool: