Jump to content
Sign in to follow this  
jben

File list wildcard

Recommended Posts

jben

hey does anyone know how to use FileListToArray as a wildcard for a folder. I presume its something like the following:

$FileList = _FileListToArray($targetDir,"",0)

and maybe put "\" as the search criteria?

thanks

Share this post


Link to post
Share on other sites
weaponx

*.* or *

Share this post


Link to post
Share on other sites
jben

Isn't that a wildcard for files though?...

I'm basically trying to check a folder to see if another folder exists within that folder..

Share this post


Link to post
Share on other sites
weaponx

Isn't that a wildcard for files though?...

I'm basically trying to check a folder to see if another folder exists within that folder..

Use FileExists(). It works with folders too.

Share this post


Link to post
Share on other sites
jben

The idea of this code is to check the 29944M_10386 folder to see if another folder exists. If another folder exists then it will rename the zip file stored within that folder. I know I could just refer to the zip folder but I have the issue that the folder name can change, therefore im trying to take a step back and code it so that my program can check the folder...

$targetDir = "C:\TEMP\29944M_10386\"
$aZipList = _FileListToArray($targetDir,"*",0)
If IsArray($aZipList) Then
    FileMove($targetDir &$aZipList[1],"\DATA_CHILD.zip")
EndIf

Share this post


Link to post
Share on other sites
jben

Sorry if i confused you. This is the original idea. Which renames the zip file to DATA_CHILD.zip..This works fine, however the 1234 folder can change, therefore I don't want to use that within the code...

$targetDir = "C:\TEMP\29944M_10386\1234\"

$aZipList = _FileListToArray($targetDir,".zip",0)
If IsArray($aZipList) Then
    FileMove($targetDir &$aZipList[1],"C:\TEMP\29944M_10386\1234\DATA_CHILD.zip")
EndIf
Edited by jben

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.