Re: Erratic behavior with fileIO xtra
On Monday, Sep 1, 2003, at 15:51 America/Chicago, Tab Julius wrote: Does it always delete the file? If the file is in use (for instance, some process has it open - you perhaps, if you didn't close it) - it won't be able to be deleted, at least not without rebooting in between or killing the process that has it open. Mm. This can also potentially be a problem in networks, I think, if the network is slow to either acknowledge the file is closed, or slow to understand it should be deleted. So if you're trying this with a file located on some kind of remote-mounted volume, you could be getting into trouble. Also if you're trying to write to something that the system, for whatever reason, wants to use, you could still be getting into trouble. What kind of file are you writing, and what is its expected path and//or name? Warren Ockrassa | President, nightwares LLC [EMAIL PROTECTED] nightwares LLC | Consulting Programming http://www.nightwares.com/ Author | Director 8.5 Shockwave Studio: A Beginner's Guide Chapter samples | http://www.nightwares.com/director_beginners_guide/ [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
Re: Erratic behavior with fileIO xtra
Enrique, Does it always delete the file? If the file is in use (for instance, some process has it open - you perhaps, if you didn't close it) - it won't be able to be deleted, at least not without rebooting in between or killing the process that has it open. Before seeing if it creates every time, see instead if it fails. Also do a 'put' or 'alert' of fPath & fName to make sure that what you have is a valid filespec. Invalid filespec means it can't do what you want. Eyeball it and make sure it makes sense (common mistakes are not having a slash at the end of the path, etc.) - Tab At 05:04 AM 9/1/03, Enrique Nivasch wrote: Hi, I'm having a weird problem with the fileio xtra. I want to create a text file on the disk and the file is only created every now and then. Sometimes Director creates the file, at other occasions it doesn't. The last time this happened I changed the global variable that contains the file path and the file was created. The next time I ran the program, without making any changes to the script, the file was not created. Any ideas? Thanks, Enrique [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
Re: Erratic behavior with fileIO xtra
Well, it doesn't seem to work. It simply work erratically. I've followed Lee's sugestion and I have placed status instructions all over the place. This is how the code looks now. on writeToFile fPath, fName, fData if objectP(gFileObject) then set gFileObject = 0 --Deletes the instance if it already exists set gFileObject = new(xtra "fileio") openFile( gFileObject, fPath & fName,0) -- Opens the file with R/W access delete (gFileObject) filestatus = status(gFileObject) textStatus=error(gFileObject, filestatus) closeFile (gFileObject) filestatus = status(gFileObject) textStatus=error(gFileObject, filestatus) set gFileObject = 0 -- Disposes of the instance set gFileObject = new(xtra "fileio") createFile( gFileObject, fPath & fName) filestatus = status(gFileObject) textStatus=error(gFileObject, filestatus) -- HERE IT HAPPENS openFile(gFileObject, fPath & fName, 0) filestatus = status(gFileObject) textStatus=error(gFileObject, filestatus) writeString( gFileObject, fData) filestatus = status(gFileObject) textStatus=error(gFileObject, filestatus) closeFile (gFileObject) filestatus = status(gFileObject) textStatus=error(gFileObject, filestatus) set gFileObject = 0 -- Disposes of the instance end I have added a comment to one of the lines, the HERE IT HAPPENS comment. When the file is not created I get an I/O Error message for the createFile instructions. Any ideas of what might be happening? Enrique - Original Message - From: "Enrique Nivasch" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 01, 2003 8:52 PM Subject: Re: Erratic behavior with fileIO xtra > It works, > > Thanks [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
Re: Erratic behavior with fileIO xtra
It works, Thanks - Original Message - From: "Daniel Nelson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 01, 2003 5:59 PM Subject: Re: Erratic behavior with fileIO xtra > The file needs to be closed after it is deleted before the file can be created again. > > Regards, > > Daniel > > > > > delete (gFileObject) > > createFile( gFileObject, fPath & fName) > > [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!] [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
re deleting from a text file with fileIO -is this a bug ? and Erratic behavior with fileIO xtra
Hi agian, excatly the same thing happens with fileXtra 4, so i've now come to the conclusion that fileIO can be relied on NOT to work properly if you use some other xtra which access the file system in some way as it always thinks the file just deleted in fact still exists if the circumstances i've described in the previous posts occur. I've redone my file writing with the Propsave xtra and it now works as i would expect ! thanks for suggestions. Enrique i found the error meesage code very useful in finding out what was happening with my fileIO problem filestatus = status(instance) alert schedulefile.error(instance) Lee Blinco Multimedia Developer AVR Productions +44 (0)1462 819603 [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
Re: Erratic behavior with fileIO xtra
The file needs to be closed after it is deleted before the file can be created again. Regards, Daniel > > delete (gFileObject) > createFile( gFileObject, fPath & fName) [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
Re: Erratic behavior with fileIO xtra
This is the handler that creates the file on writeToFile fPath, fName, fData if objectP(gFileObject) then set gFileObject = 0 --Deletes the instance if it already exists set gFileObject = new(xtra "fileio") openFile( gFileObject, fPath & fName,0) -- Opens the file with R/W access delete (gFileObject) createFile( gFileObject, fPath & fName) openFile(gFileObject, fPath & fName, 0) writeString( gFileObject, fData) closeFile (gFileObject) set gFileObject = 0 -- Disposes of the instance end The handler is called from here on activate fData=receivedTex.item[2] writeToFile securityfPath, securityfName, fData ProcessData (fData) end activate - Original Message - From: "Tab Julius" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, September 01, 2003 11:49 AM Subject: Re: Erratic behavior with fileIO xtra > > > It might help if you would post the code you are using. > > > At 05:04 AM 9/1/03, Enrique Nivasch wrote: > >Hi, > > > >I'm having a weird problem with the fileio xtra. > > > >I want to create a text file on the disk and the file is only created every > >now and then. Sometimes Director creates the file, at other occasions it > >doesn't. > > > >The last time this happened I changed the global variable that contains the > >file path and the file was created. The next time I ran the program, without > >making any changes to the script, the file was not created. > > > >Any ideas? > > > >Thanks, > > > >Enrique > > [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!] > [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
Re: Erratic behavior with fileIO xtra
It might help if you would post the code you are using. At 05:04 AM 9/1/03, Enrique Nivasch wrote: Hi, I'm having a weird problem with the fileio xtra. I want to create a text file on the disk and the file is only created every now and then. Sometimes Director creates the file, at other occasions it doesn't. The last time this happened I changed the global variable that contains the file path and the file was created. The next time I ran the program, without making any changes to the script, the file was not created. Any ideas? Thanks, Enrique [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
Erratic behavior with fileIO xtra
Hi, I'm having a weird problem with the fileio xtra. I want to create a text file on the disk and the file is only created every now and then. Sometimes Director creates the file, at other occasions it doesn't. The last time this happened I changed the global variable that contains the file path and the file was created. The next time I ran the program, without making any changes to the script, the file was not created. Any ideas? Thanks, Enrique -- Flash and Director programming, visit: http://flashysites.net Computer sales and repairs, visit: http://www.SrEnrique.co.il Cel: 053 586386 P.O. Box 875, Ra'anana 43108, Israel [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]