Simple story, not so obvious answer.
I have a Console app uploaded to my Xojo Cloud. The app is run from a Shell, which a Web App provides. Thank you Greg for helping that functionality come to pass.
The console App is a Linux build and lives in the Shared_Documents folder, in a folder named TMW-Alpha. It references local files, in particular a log file (ProjectLog.txt) in the same folder as the console app. This folder also contains the console app Libs folder.
Now if you are a hardworking, decent person, you might think that you reference this TMW-Alpha folder as a subfolder within SpecialFolder.SharedDocuments … and you would be wrong. That does not work (i.e. nil object exception). A Linux build, even though it runs within the Xojo Cloud environment, cannot find the Shared_Documents folder of your Xojo Cloud using any SpecialFolder notation that I have found. If others know of secret sauce which will divulge this folder easily, please share !
My solution is sufficiently ugly that I have thought to share it here, so that others may read, and weep.
[code]dim fA, fA2, fA3, fA4, fA5, fB as folderItem
if debugBuild then
return SpecialFolder.Desktop.child(“Text-Me-Web-Folder”).child(“ProjectAlpha”)
else
fA = SpecialFolder.CurrentWorkingDirectory
if fA.exists = false then return nil
fA2 = fA.child("home")
if fA2.exists = false then return nil
fA3 = fA2.child("sites")
if fA3.exists = false then return nil
fA4 = fA3.child("www.example.com")
if fA4.exists = false then return nil
fA5 = fA4.child("Shared_Documents")
if fA5.exists = false then return nil
fB = fA5.child("TMW-Alpha")
if fB.exists = false then return nil
return fB[/code]
This ugliness will return a folderItem that is either nil, or points to the desired location ( a subfolder named TMW-Alpha within the Shared_Documents folder).
Hope this will save others in their search for their folders.
Regards,
Tony Barry
Sydney