Jump to content
Sign in to follow this  
AndyScull

Weird FileFindFirstFile behavior

Recommended Posts

AndyScull

I am upgrading my backup script and bumped into this strange thing.

Here's the code:

$targetfolder = "D:py3backuptarget"
$filename = "test1"
$searchstr = $targetfolder & $filename & "_??????.7z"
$search = FileFindFirstFile($searchstr)
$fname = FileFindNextFile($search)
ConsoleWrite($searchstr & @CR & $fname & @CR)

And here's ConsoleWrite debug output:

"C:Program Files (x86)AutoIt3SciTE..autoit3.exe" /ErrorStdOut "D:Temptest11.au3"    
D:py3backuptargettest1_??????.7z
test1_120325_full.7z
>Exit code: 0   Time: 0.216

So, my problem is: Why does it catch _full.7z file? It does not fit the mask. Help file definitely says that ? substitutes exactly 0 or 1 character.

//edit

I read a little below in the help file, it explains my 'problem'.

The question changed - is there an easy way to use standart dos wildcard without getting list of all files and checking each of them with regexp?

Edited by AndyScull

Share this post


Link to post
Share on other sites
KaFu

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.