ycomp Posted April 17, 2008 Share Posted April 17, 2008 I want to get a list of the directories in a directory to an array. I am going to use filefindfirstfile/next unless there is a better way. (know of any?) So I have done that and I get the filenames and directories. Now I am lost at how to detect if it is a directory or not... all I can think of is to change the directory and see if it succeeds... but obviously there must be a better. Please tell me what I am overlooking here. Also, anyone know what function to use to get the filename only of a file? I mean strip the path? if there is not such a function, what regexp can I use to do this? thanks Link to comment Share on other sites More sharing options...
weaponx Posted April 17, 2008 Share Posted April 17, 2008 1. _FileListToArray() 2. $array = StringSplit("c:\path\to\filename.txt", "\") $filename = $array[$array[0]] Link to comment Share on other sites More sharing options...
ycomp Posted April 17, 2008 Author Share Posted April 17, 2008 1. _FileListToArray() 2. $array = StringSplit("c:\path\to\filename.txt", "\") $filename = $array[$array[0]] wow, cool.. that's easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now