On Tuesday, February 21, 2017 at 11:52:49 AM UTC+8, Lehi Toskin wrote:
> In `get-file-list`  there is a filter argument that can be passed to the 
> function such that when going through a directory it'll only list directories 
> and those files in the filter (separated by a semicolon). This can get rather 
> unruly when the filter is rather large. At current count, I have a filter of 
> 14 different file extensions accounting for spelling or case (e.g. 
> "*.jpg;*.jpeg;*.JPG;*.JPEG"). Is there a way to do this more 
> programmatically? I don't mean using a procedure to create the string, but 
> that instead of a string it'd be, say, a predicate.
> In various GUI programs, the selection would be simply "All Images" or "Any" 
> without specifying exactly what list of file extensions it's filtering. I 
> suppose that behavior itself is fine, which would mean hiding the file 
> extensions from the filter choice and only showing the name of the filter.

The documentation for get-file-list (well, actually get-file) suggests that it 
uses a platform specific dialog box.  On windows platforms, I suspect  that 
would be GetOpenFileName which accepts filter string in the same format as 
required by get-file-list.  It is likely that the filter is passed directly to 
the windows function and as such, it has to be a string.

This was just a long way of saying that you cannot have a predicate for the 
filter, at least not while using the platform specific "File Open" dialog boxes.

However, the documentation does have an example for a shorted pattern for JPEG 
files: "*.jp*g"

Best regards,

You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to