On Dec 12, 2006, at 1:38 PM, Ed Harris wrote:
I am running into a problem that has been discussed occasionally
over the
past 6 years, but I can't find a definite solution. It concerns the
"createtextfile" method sometimes returning a NIL object. This occurs
primarily on Mac OS X 10.3.
The code is essentially:
Dim fi as FolderItem
Dim tos as TextOutputStream
fi = GetFolderItem("Temp.html")
tos = fi.CreateTextFile
tos.write "This is a test"
tos.close
It seems to almost always work on OS X 10.4, by the way, and always
works on
a Windows machine.
Additional information: the file "Temp.html" exists and I am
expecting it to
be overridden. Also, I have added "errNr = fi.LastErrorCode" after
the
GetFolderItem line. When the CreateTextFile method fails and
returns NIL,
the value of errNr is 104.
Any ideas on what is going on and how to fix it?
Error 104 = "File in use". The documentation for
FolderItem.LastErrorCode contains a list of Rb-defined error codes.
Negative error codes on MacOS are MacOS error codes. I don't know
about Windows.
You should check to see whether your app already has the file open.
If you think not, try the Terminal command lsof and see if the file
is somewhere amidst the output.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>