BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
djhanson
Community Trekker

Delete File() supported with wildcard?

Anyone know if a wildcard can be used with the Delete File () command?  I tried *, ? and % but none appear to work.  Just curious if there could be another way (besides using Delete Directory() )?  thx... dj

Like: Delete File("C:\temp\*.jpg");

0 Kudos
2 REPLIES 2
michaelhaslam_p
Community Trekker

Re: Delete File() supported with wildcard?

djhanson:

I do not know of wildcards being supported in the Delete File function.  I would suspect this is a safety issue ... deleting files by mistake from JMP.

However, you could create your own function that would accept wildcards using JMP's PatMatch function with the PatArb function.  Grab the files in your target directory using the files in directory function and then pattern match them, flagging them for use with the Delete File function.

Of course, be careful.  I personally do not use such a function in my scripts because of the risk.

Michael Haslam

0 Kudos
jschroedl
Staff

Re: Delete File() supported with wildcard?

Unfortunately, DeleteFile does not currently support wildcards.

John

0 Kudos