We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
file existence? (Read 518 times)
file existence?
May 16th, 2008, 7:25pm
 
hey all

How would i go about checking the existence of a *.txt file on my own FTP and writing to it. im not sure where to start
Thanks

Nic
Re: file existence?
Reply #1 - May 17th, 2008, 3:05pm
 
Searching FTP with the search facility of this site, I found http://processing.org/hacks/doku.php?id=hacks:ftp which shows how to use a library to do FTP stuff. There is a section showing how to get a list of files.

Writing to it: download, append, upload.
Re: file existence?
Reply #2 - May 18th, 2008, 8:02pm
 
Hey , Thanks for the reply, i dont really understand the use of this package but i will look into it further. I am more concerned at the moment with finding weather or not the file exists on the server, Is this possible  ?
Re: file existence?
Reply #3 - May 18th, 2008, 11:50pm
 
If you can get a directory listing, you can loop through it and check for the file of interest, and that link that PhiLho posted shows how to get the listing, so see if you can figure out how to edit that sample code to get what you want.  You'll want to use string.equals to test for string equality rather than == (see http://processing.org/reference/String.html and the links there).  If you have trouble, feel free to ask for help, but it's always better to try to figure it out first - the example code there is pretty clear, so I think you'll get a lot more out of playing with it than if one of us posts a cut and paste snippet.
Re: file existence?
Reply #4 - May 19th, 2008, 4:48pm
 
Ok ill have a bash! thanks alot both
Page Index Toggle Pages: 1