On 2006-12-12, at 20:58, Peter E. Barck wrote:
On 2006-12-12, at 20:13, Peter E. Barck wrote:
On 2006-12-12, at 19:38, 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?
Thanks,
Ed
I have no problems with the . CreateTextFile method. I use it
in several applications. I am running 10.3.9 on a G4 PPC
However, I check if the file "Temp.html" exists. If it does, I
delete it first,
You can't delete the file! because it is in use (LastErr 104) ,
that was the problem... You have to restart your application
Then close the file. Then you can delete it.
The file is closed, at least is the RB command used to do it...
I always close a file when I'm done using it. I have never seen the
problems you describe.
So do I, and perhaps also Ed...
Here is a similar...
http://support.realsoftware.com/listarchives/realbasic-nug/2004-12/
msg02443.html
Peter
Sven E
Sven E
_______________________________________________
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>