CurrentWorkingDirectory

Xojo 2015R1
Linux Mint 17 64bit

MsgBox SpecialFolder.CurrentWorkingDirectory.ShellPath

This gives me “/home/{username}” instead of the “/home/{username}/xojo/{sample application directory}” that I would have expected from the description from the documentation. SpecialFolder Is there another property of the SpecialFolder that would give me the current application directory? or should I just shell out and get the directory with a pwd ?

You can use GetFolderItem and pass in the name of the file located next to your application that you’re interested in.

Right. I was forgetting that during debugging that default directory is switched to “Debug{MyApplication}” directory and not the directory that the project file is normally in. The path is so long it was hard to see it in the debugger.

So, is the SpecialFolder.CurrentWorkingDirectory incorrect for Linux? or is the documentation out of date? or am I missing something?

[quote=170082:@Kevin Cully]Right. I was forgetting that during debugging that default directory is switched to “Debug{MyApplication}” directory and not the directory that the project file is normally in. The path is so long it was hard to see it in the debugger.

So, is the SpecialFolder.CurrentWorkingDirectory incorrect for Linux? or is the documentation out of date? or am I missing something?[/quote]

SpecialFolder.CurrentWorkingDirectory just calls into getcwd. It’s much more likely that the working directory simply isn’t what you’d expect it to be.

The documentation states depends on the location of the application so that made me believe that it would work similar to the GetFolderItem("").

That sounds like a bug in the documentation. It only depends on the current working directory at the time the application was launched.