I do not know if FolderItem.Launch has ever worked in Linux when spaces in filename,
the error has now happened to me for the first time
dim f as FolderItem = GetFolderItem("/Axel_2/TestFolder/my test.txt", 3)
if f <> nil and f.Exists then
Window1.Title = "File found"
f.Launch
else
Window1.Title = "File not found"
end if
Error:
[quote]Die Adresse »file:///Axel_2/TestFolder/my%5C%20test.txt« konnte nicht geöffnet werden.
Fehler beim Holen der Informationen für Datei »/Axel_2/TestFolder/my\ test.txt«: Datei oder Verzeichnis nicht gefunden.[/quote]
(can not be opened, file not found)
that confuses me, who changes the path here? Xojo or Ubuntu ?
I would strongly suggest NOT writing it as you have using an integer value since its not clear what 3 means making your code unnecessarily unclear
Instead use the defined constants that help your code be readable
dim f as FolderItem = GetFolderItem("/Axel_2/TestFolder/my test.txt", FolderItem.PathTypeNative)
I compiles in EXACTLY the same way since this is a defined constant but the code ends up being much more readable with that one tiny change
[quote=312141:@Axel Schneider]You mean in the forum?
[/quote]
Everywhere
Should any future version of Xojo alter the constants your code will break - but it wont with the constants unless we remove one
It will continue to work if you use the constant
Anyone you share code with will appreciate it (like us here in a bug report)
and launch may be failing for reasons completely unrelated to the path
its certainly possible to get a valid folderitem that is constructed from a path with spaces in it
and launch may still fail
I’m not sure how, on linux, it figures out what app to use to “launch and open” the relevant folderitem
That may be the issue here