Hello, good people!
I'd like to use the same wildcard filters I may use in a DO internal command like Copy to filter files inside a JScript function.
I started writing a function to convert wildcard syntax to RegExp, but then I came to the not
operator (~
) and had to give up on that dream.
A) Is there any way to check if a file (Item) (or basically any string representing a path) matches a given wildcard pattern as defined by DO?
B) Is there maybe an internal command that returns filter/search results as a list of strings?
C) Can I maybe request FSUtil.ReadDir to get an update to accept a filter string?
What alternatives come to mind?
Answer:
As I was writing this and trying to come up with alternatives, I realized that DOpus already has exactly what I was looking for in A:
Wild object (FSUtil.NewWild)
I had simply overlooked that. (To be fair, I wasn't imagining a helper function to create an "abstract" (not in the class sense) wildcard object to be a thing)
I think I'll post this anyway, since my initial searches like "Directory Opus use wildcard pattern in JScript" on Google and in this forum didn't turn up anything