Re: Deleted Files

2010-06-02 Thread Bob Sneidar
Too little information. I can think of at least one way: Volume Corruption. I 
can think of another way: File was not saved where you thought it was saved. 
Yet another way: User or app appears to have saved the file but in reality, 
didn't. 

Bob


On Jun 2, 2010, at 9:02 AM, Dan Friedman wrote:

 Hey...
 
 I am writing compressed XML data to file on a server using the put command.  
 Every now and then, I get a report from a user that when they go to read the 
 data, they are getting an error.  When I look on the server, the file is 
 gone!  Not empty, not zero K... just gone - nonexistent!
 
 Let's assume for a moment that the file was there to begin with, and there is 
 no one messing with the data and secretly deleting things.  It must be 
 something in my app that is causing this.  But, what could it be?  Nowhere am 
 I deleting a file.
 
 Can anyone think of a way you could delete a file without actually deleting 
 it?
 
 I tried:
 
   put compress() into url x
 
 I thought that compressing empty might do something funny.  But it didn't, 
 it just wrote some gargly-goop.
 
 
 ANY thoughts out there??
 
 Thank you in advance,
 Dan___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Deleted Files

2010-06-02 Thread Dan Friedman
Bob,

Thank you VERY much for the insight.  I really need some help resolving this 
problem.  However

 Volume Corruption

On one file only?  I suppose that possible, but I think it's pretty unlikely.

 File was not saved where you thought it was saved. 

Then why would the original file have been deleted?

 User or app appears to have saved the file but in reality, didn't. 

Again, why would the original file have been deleted?


-Dan 





On Jun 2, 2010, at 10:00 AM, use-revolution-requ...@lists.runrev.com wrote:

 Too little information. I can think of at least one way: Volume Corruption. I 
 can think of another way: File was not saved where you thought it was saved. 
 Yet another way: User or app appears to have saved the file but in reality, 
 didn't. 
 
 Bob
 
 
 On Jun 2, 2010, at 9:02 AM, Dan Friedman wrote:
 
 Hey...
 
 I am writing compressed XML data to file on a server using the put command.  
 Every now and then, I get a report from a user that when they go to read the 
 data, they are getting an error.  When I look on the server, the file is 
 gone!  Not empty, not zero K... just gone - nonexistent!
 
 Let's assume for a moment that the file was there to begin with, and there 
 is no one messing with the data and secretly deleting things.  It must be 
 something in my app that is causing this.  But, what could it be?  Nowhere 
 am I deleting a file.
 
 Can anyone think of a way you could delete a file without actually deleting 
 it?
 
 I tried:
 
  put compress() into url x
 
 I thought that compressing empty might do something funny.  But it didn't, 
 it just wrote some gargly-goop.
 
 
 ANY thoughts out there??
 
 Thank you in advance,
 Dan

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Deleted Files

2010-06-02 Thread Bob Sneidar
After reading a bit more of your original post, I think I understand that you 
are creating an XML file each time you do a PUT? If so, are you PUTTING to 
the same file name each time? If so, then if the command fails for some reason 
the file system would delete the original, and then the new file, having failed 
would never get to the server. It might be better to rename the original, PUT 
the new XML file, verify the existence of the file after PUTTING it, then 
delete the old one. 

I'm curious why you are using this command and not the low level file commands:
open file
read from file
write to file
close file

Bear in mind I'm not an expert on low level file commands. I am simply curious 
about your method. 

Bob


On Jun 2, 2010, at 10:32 AM, Dan Friedman wrote:

 Bob,
 
 Thank you VERY much for the insight.  I really need some help resolving this 
 problem.  However
 
 Volume Corruption
 
 On one file only?  I suppose that possible, but I think it's pretty unlikely.
 
 File was not saved where you thought it was saved. 
 
 Then why would the original file have been deleted?
 
 User or app appears to have saved the file but in reality, didn't. 
 
 Again, why would the original file have been deleted?
 
 
 -Dan 
 
 
 
 
 
 On Jun 2, 2010, at 10:00 AM, use-revolution-requ...@lists.runrev.com wrote:
 
 Too little information. I can think of at least one way: Volume Corruption. 
 I can think of another way: File was not saved where you thought it was 
 saved. Yet another way: User or app appears to have saved the file but in 
 reality, didn't. 
 
 Bob
 
 
 On Jun 2, 2010, at 9:02 AM, Dan Friedman wrote:
 
 Hey...
 
 I am writing compressed XML data to file on a server using the put command. 
  Every now and then, I get a report from a user that when they go to read 
 the data, they are getting an error.  When I look on the server, the file 
 is gone!  Not empty, not zero K... just gone - nonexistent!
 
 Let's assume for a moment that the file was there to begin with, and there 
 is no one messing with the data and secretly deleting things.  It must be 
 something in my app that is causing this.  But, what could it be?  Nowhere 
 am I deleting a file.
 
 Can anyone think of a way you could delete a file without actually deleting 
 it?
 
 I tried:
 
 put compress() into url x
 
 I thought that compressing empty might do something funny.  But it 
 didn't, it just wrote some gargly-goop.
 
 
 ANY thoughts out there??
 
 Thank you in advance,
 Dan
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Deleted Files

2010-06-02 Thread Richard Gaskin

Dan Friedman wrote:


File was not saved where you thought it was saved.


Then why would the original file have been deleted?


User or app appears to have saved the file but in reality, didn't.


Again, why would the original file have been deleted?


libURL uses the STOR FTP command to post files.  I know that when a file 
already exists at the specified location the new file will overwrite it, 
but I'm not clear on the exact sequence of actions it will use to do so.


It may be that the original file is deleted by the FTP server 
immediately before the new file is written, and if that's the case there 
may be a problem with the FTP server in question or the data transfer to 
it which is allowing the first action (delete) to take place without 
being followed by the second (write).


Your client-side logs from libURL won't be able to help you, but there 
may be some diagnostics that can be done by a tech on the server side to 
see those specifics.


--
 Richard Gaskin
 Fourth World
 Rev training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
 revJournal blog: http://revjournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Deleted Files

2010-06-02 Thread Dan Friedman
Bob,

I am using the put because I am writing to a ftp web server.   So I need to 
pass a username and password.

How would I rename the file on a remote server?  Also, how would you suggest I 
go about this?  I could end up in a endless error check...

rename the original file
write the data
if error then
  rename the original file back
  if error then
then what?

What do you think?

-Dan


 After reading a bit more of your original post, I think I understand that you 
 are creating an XML file each time you do a PUT? If so, are you PUTTING to 
 the same file name each time? If so, then if the command fails for some 
 reason the file system would delete the original, and then the new file, 
 having failed would never get to the server. It might be better to rename the 
 original, PUT the new XML file, verify the existence of the file after 
 PUTTING it, then delete the old one. 
 
 I'm curious why you are using this command and not the low level file 
 commands:
 open file
 read from file
 write to file
 close file
 
 Bear in mind I'm not an expert on low level file commands. I am simply 
 curious about your method. 
 
 Bob
 
 
 Thank you VERY much for the insight.  I really need some help resolving this 
 problem.  However
 
 Volume Corruption
 
 On one file only?  I suppose that possible, but I think it's pretty unlikely.
 
 File was not saved where you thought it was saved. 
 
 Then why would the original file have been deleted?
 
 User or app appears to have saved the file but in reality, didn't. 
 
 Again, why would the original file have been deleted?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Deleted Files

2010-06-02 Thread Bob Sneidar
Sorry Dan I missed the remote aspect of things. I was thinking you were on a 
local area network using a file share. 

I believe there are FTP commands to rename files. I'm not certain though. 
Assuming you can, it is doubtful an FTP server would allow the first file 
rename but not the second, should the new write fail. Also, doesn't the FTP 
server respond if there is an error with the command? I mean, you can never 
completely guarantee a remote site will still be there a split second later, 
but I think it would go more like this (pseudo wise):

open connection
check result 
if ok, see if file exists with same name as the one you are going to write
if it does, rename the old file
check the result
if ok, write new file
check the result
if ok, delete renamed file
if error anywhere either reconnect and try again, or bail out. 

At least you will have the renamed file sitting there in the odd circumstance 
that there was a disconnect. You can have a repeat loop that tries x number of 
times, that exits if everything works or the counter gets to x. And you would 
be able to tell if your SEND command was actually failing, because you would 
have a renamed file, but no new file. 

Bob


On Jun 2, 2010, at 3:08 PM, Dan Friedman wrote:

 Bob,
 
 I am using the put because I am writing to a ftp web server.   So I need to 
 pass a username and password.
 
 How would I rename the file on a remote server?  Also, how would you suggest 
 I go about this?  I could end up in a endless error check...
 
 rename the original file
 write the data
 if error then
  rename the original file back
  if error then
then what?
 
 What do you think?
 
 -Dan

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Deleted Files

2010-06-02 Thread Richard Gaskin

Dan Friedman wrote:

 How would I rename the file on a remote server?

libURL does it's magic with FTP, and FTP does its magic with a set of 
commands available for the protocol, including two for renaming files:


http://www.nsftools.com/tips/RawFTP.htm#RNFR


Thankfully, Dave Cragg opens the door to use any of them with the libURL 
call libUrlFtpCommand - e.g., to rename a file:


  get  libUrlFtpCommand(RNFR mydomain.com/file.dat,\
   myserver.com,myFtpLogin,myPassword)

  get  libUrlFtpCommand(RNTO mycomain.com/newname.dat,\
   myserver.com,myFtpLogin,myPassword)


Wonderfully detailed notes on everything in libURL here:
http://www.lacscentre.com/liburl/liburldoc.html

--
 Richard Gaskin
 Fourth World
 Rev training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
 revJournal blog: http://revjournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Deleted Files

2010-06-02 Thread Kay C Lan
On Thu, Jun 3, 2010 at 1:47 AM, Bob Sneidar b...@twft.com wrote:


 I'm curious why you are using this command and not the low level file
 commands:
 open file
 read from file
 write to file
 close file

 Bear in mind I'm not an expert on low level file commands. I am simply
 curious about your method.

 There could be two reasons. Firstly this Tip at the bottom of the
Dictionary entries for the above 4 commands:

Tip:  As an alternative to the open file, read from file, and write to
 filecommands, you can also use the URLkeyword with get, put, and other
 commands to access the contents of a file.


Personally, if it's a Tip, it suggest to me that it's a better way to do
something. My understanding by using 'put someData into URL 
ftp://www.mySite.net' you avoid the need to open and close a file, plus, as
mentioned, you get to work with servers.

Additionally, you avoid this problem, as mentioned in the dictionary:

Important: before opening any file for writing to, remember to back up the
 file contents as Revolution will erase them even if you don't write to the
 file after opening it.


Does seem important.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution