Forum > LCL

[Solved] OpenFile Dialog - Windows and Linux

(1/3) > >>

Windsurfer:
While porting an application form Windows to Linux, (Windows 8 to Mint 15) I noticed that Windows will detect uppercase filenames with a lowercase filter (*.sbn will detect FRED.SBN). However, in Linux this does not work. The filter must also be uppercase.

In Linux I  tried listing two filters (*.sbn, *.SBN) but it did not work.

[Edit: But *.sbn; *.SBN does work. I used the wrong list separator]

Should Windows and Linux work in the same way when using the LCL?

Is there a neat way of detecting filenames in both cases?

howardpc:

--- Quote from: Windsurfer on September 18, 2013, 03:14:16 pm ---Should Windows and Linux work in the same way when using the LCL?

--- End quote ---
Of course not, since Linux is case sensitive with respect to filenames and Windows is (almost always) case insensitive.
You have to respect each operating system's default mode of file access.
You might wish that aFile.ext was the same file as AFILE.EXT on Linux (as it is on Windows), but the fact is they are two different files, and can coexist in the same folder on Linux.

taazz:
No he actually wishes to find a way to collect all files with a specific extension regardless the case how is that done in linux? using both extensions eg "*.sbn;*.SBN" is not going to help if there are file with the extension *.Sbn so is there any way to define that the filter is case insensitive?

Windsurfer:
Thanks for your comments. They have clarified my thoughts.

What I need is something like the old database trick of using Upper() and Lower() to force consistency. The application is specific for an particular file type (Windows style).

Could that be a useful addition to the dialog?

fedkad:
Sorry again to raise an old topic!  :)

I have a similar problem. While porting a Windows application to Linux, I noticed that a filter like "Text File (*.TXT)|*.txt" in the TOpenDialog will show only the file names ending with .txt, and not files ending with .TXT, .Txt, .tXt, .txT, .TXt, etc.

I want a method to show matching file names ending with all lower and upper case combinations of .txt. For example, in LibreOffice Open File dialog, if you select ODF Text Document, the file list will show all the files like this: a.odt, a.ODT, a.OdT, a.oDt, and so on.

I was expecting something like "ofCaseInsensitiveFilter" type of Option in the TOpenDialog dialog.

One solution would be to list *all*combinations in Filter. For a three-letter "extension" we will need 8 of them.

Any other ideas?

Navigation

[0] Message Index

[#] Next page

Go to full version