Hi all,
REALbasic 2007r2 Standard for Linux
REALbasic 2007r2 Professional for Mac OS X
REALbasic 2007r2 Standard for Windows
The code below returns on Linux only the error message found in the If
OSErrCode <> 0... line.
But the application creates that Directory.
On Mac OS X and Windows, nothing is reported.
Why ?
Emile
PS: on a second run (after the folder been created), the application running in
the IDE says nothing (.Exists works!).
PS2: the event order is really important and is different on Linux. I add a
crash because of that, so I added an If block and initialize the variable in
that block and I do not have that ... NilObjectException anymore. This was fun.
Note: The FI suffix stands for Folderitem.
// a. Store the default string
gDownloadDefault = "Download_Folder"
// b. Build the default download folder FolderItem Class instance
gURLTrgtDwnldFI = App.gAppRootFI.Child(gDownloadDefault)
// c. Check if a folder using that name exists there
If gURLTrgtDwnldFI.Exists Then
// OK it Exists !
Else
// Folder Not Found ! I create it right now
gURLTrgtDwnldFI.CreateAsFolder
// Get the last error code
OSErrCode = gURLTrgtDwnldFI.LastErrorCode
// And check its value
If OSErrCode <> 0 Then
MsgBox locErrHead + "Unable to create the 'Download_Folder' directory."
Return
End If
End If
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>