Posted by Zog in SWF Studio V3 on Dec 18 2008, 06:40 pm

As a definition of FileSys.findFiles in help file stays:

"Search the file system for files with names matching a pattern."

How can I get this function to search for file by its name as it says in definition and not by its extension?


Posted by ananthforu in SWF Studio V3 on Dec 19 2008, 04:07 am

In ssCore.FileSys.findFiles there is a optional parameter called Filter. If you not pass any values it will search all files (*.*).

You can pass the parameter like this. Filter:"FileName.* "
It will give you the result of all types.

Say for example

var searchResult = ssCore.FileSys.findFiles({path:"startdir://", subfolders:true, filter:"Sample.*"});


Posted by Zog in SWF Studio V3 on Dec 19 2008, 06:22 am

Yes, it works perfect. Thanks.


Posted by Zog in SWF Studio V3 on Dec 19 2008, 12:31 pm

One question more, is it possible to find file with partial filename, like windows file search?


Posted by northcode in SWF Studio V3 on Dec 19 2008, 02:25 pm

The FileSys.findFiles function is a wrapper around the Windows FindFirstFile/FindNextFile API functions so the filter you supply can contain wildcard characters (* and ?) in any valid combination supported by Windows. I don't believe this supports everything that you can do with the Windows Search function, but it's pretty flexible.


Posted by Zog in SWF Studio V3 on Dec 21 2008, 05:37 pm

Thanks, I undestand now, actually I am interested only at partial file name match and " filename* " does the job.