Hello all -
I need to access a file from a directory that is a folderitem of a symbolic link, but Xojo 2014r1.1 on Linux Mint 16 Petra (64 bit) and OS X (10.9.3) both fail with reporting the file does not exist.
I’ve been staring at the debugger all day on both Linux and OS X and I’m out of ideas. First thought is that it doesn’t seem like the folderitem that gets assigned to the symlink for the ‘TestDir’ is not resolving correctly.
Here’s the sample code from the test app:
[code]dim mAppFolder as FolderItem = GetFolderItem("")
// The files below are created in the ‘CreateSymLinks[TARGET]’ build step:
dim mSymLinkDir as FolderItem = mAppFolder.Child(“TestDir-SymLink”)
dim mSymlinkFileInDir as FolderItem = mSymLinkDir.Child(“TestFileA-Symlink”)
if ( mSymlinkFileInDir.Exists ) then
SymFileInDirTestLabel.Text = "mSymlinkFileInDir exists."
else
SymFileInDirTestLabel.Text = "mSymlinkFileInDir does NOT exist."
end if
[/code]
I’ve double checked that the paths are correct in the terminal. In fact I’m creating the real directory and file within it and all symlinks in a build step for both OS X and Linux:
[code] // Create the real directory and file first:
Call DoShellCommand( "/bin/mkdir " + CurrentBuildLocation + “/TestDir” )
Call DoShellCommand( "/bin/echo TestFileA >> " + CurrentBuildLocation + “/TestDir/TestFileA” )
// Now create the symlink to the directory and the file within:
Call DoShellCommand( "/bin/ln -s -f " + CurrentBuildLocation + "/TestDir " + CurrentBuildLocation + “/TestDir-SymLink” )
Call DoShellCommand( "/bin/ln -s -f " + CurrentBuildLocation + "/TestDir/TestFileA " + CurrentBuildLocation + “/TestFileA-Symlink” )
[/code]
The Xojo docs reports that the .child method should resolve all symbolic links on OS X and Linux, but then how should I get a file that is within that folderitem that was created with a .child(“SymLink-DirName-Here”) ?