Xojo.io.FolderItem and space in folder names

I just tried to get a folder containing a space, and it simply never works.

I tried :

dim f as new xojo.IO.FolderItem("/Users/Mitch/Documents/Virtual Machines") dim f as new xojo.IO.FolderItem("/Users/Mitch/Documents/Virtual\\ Machines") dim f as xojo.IO.FolderItem = Xojo.io.SpecialFolder.Documents.child("Virtual Machines")

None of these work.

If I rename the folder Virtual_Machines and replace the space by underscore in the code, it works just fine.

Is it possible that there is no way to have a file/folder name with a space into it ? Could it be a bug ?

[quote=254593:@jean-paul devulder]strange, work for me
[/quote]

I created a “My Site” folder in Documents, works perfectly, says OK. When I replace that by “Virtual Machines” in the path, it triggers error. I even checked in case the space was a non breakable one, it is not the case. Of course there is a Virtual Machines folder.

Well I created a “Virtual Machines” directory in my Documents folder
and ran this code

  //Dim f As New xojo.IO.FolderItem("/Users/DaveS/Documents/Virtual Machines") // test #1
  //Dim f As New xojo.IO.FolderItem("/Users/DaveS/Documents/Virtual\\ Machines") // test #2
  Dim f As xojo.IO.FolderItem = Xojo.io.SpecialFolder.Documents.child("Virtual Machines") // test #3
  If f=Nil Then 
    MsgBox("NIL")
  Elseif f.exists=False Then 
    MsgBox("Not Exists")
  Else
    MsgBox("All is well")
  End If

Test #1 and #3 came bake “All is well”
Test #2 came back “Not Exists”

OSX El Capitan [10.11.3]
Xojo 2015r4

Congratulations, Jean Paul ! You found indeed the source of the error :slight_smile:

Indeed with “Virtual Machines.localized”, the code runs perfectly.

Now, the plot thickens. Mac OS X was set to display extensions in the Finder preferences. How did VMware found a way to hide it for just that very folder ? Just curious.

It might be just a function of .localized since the idea is to localize the display name, OS X might hide it in case you had something like MyDocument.doc.localized

Thank you Jean-Paul.

That is indeed a neat way to deal with multiple languages.