dim path As FolderItem= SpecialFolder.Documents
dim f as FolderItem= path.Child("prefs.ini")
works fine
but when trying to use SpecialFolder.CurrentWorkingDirectory it errors with “This item does not exist”
The old framework was easy if no path was assigned it used the current directory.
What am i missing?
TIA
Tim
Works just fine here under Mac OS X El Capitan 10.11.1 and Xojo 2015R3.
It shows it’s path to be “/”.
Forgot to add “Using Xojo.io” in my code sample above.
CurrentWorkingDirectory is not a method of Xojo.io, so it makes sense why I get the error.
So question is: How do I get the current working directory using Xojo.io?
BTW the sample
Xojo.io Folder item does not work ( "Path must be an absolute path ") and the reason I need the current directory
Dim f As New Xojo.IO.FolderItem(“test.txt”)
If f.Exists Then
// open the file
End If
Thanks
Tim
You don’t.
You may want to file a feature request.
In the meantime, while using Xojo.io, you may want to try
Global.SpecialFolder.SpecialFolder.CurrentWorkingDirectory
https://forum.xojo.com/21710-using-and-mixing-frameworks/0
Kind of involved, but it works just fine :
using xojo.IO
dim f As New Xojo.IO.FolderItem( global.specialfolder.CurrentWorkingDirectory.NativePath.ToText)