Jump to content

Recommended Posts

Posted

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

Posted

1. _FileListToArray()

2.

$array = StringSplit("c:\path\to\filename.txt", "\")

$filename = $array[$array[0]]

Posted

1. _FileListToArray()

2.

$array = StringSplit("c:\path\to\filename.txt", "\")

$filename = $array[$array[0]]

wow, cool.. that's easy

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...