Subscribe Bookmark RSS Feed

Delete File() supported with wildcard?

djhanson

Community Trekker

Joined:

Jun 23, 2011

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");

2 REPLIES
michaelhaslam_p

Community Trekker

Joined:

Sep 15, 2013

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

jschroedl

Staff

Joined:

Jun 23, 2011

Unfortunately, DeleteFile does not currently support wildcards.

John