Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FTP Widget and widget.system("ftp...), handler)



Hello,

Currently I am writing a FTP Widget. Eerything is almost finished, but there is one problem I haven't been able to solve. Here is the code:

...
parameters ="ftp -i ftp://"; + widget.preferenceForKey("user") + ":" + widget.preferenceForKey("pwd") + "@" + widget.preferenceForKey ("host") + "/" + widget.preferenceForKey("path") + " << 'END_FTP'\n" +
"put " + localFile.replace(/')/g, "\\'").replace(/"/g, '\\"')
+ ' ' + remoteFile.replace(/')/g, "\\'").replace(/"/g, '\\"') + "\n" +
"END_FTP\n";


		
//Starting the widget.system request
ftpCommand = widget.system(parameters, ftpFinish);
ftpCommand.onreadoutput = ftpConnect;
ftpCommand.onreaderror = ftpError;
...

The problem is, that the onreadoutput handler is never called. Just the onreaderror handler is called when an error occures. The first problem about that is: I can't show any progress, but the main problem is that if the directory doesn't exists (on the server) there is no error created, so I can't handle that. Is there any possibilty to get onreadoutput called every time ftp writes sth to stdout (please try ftp in the terminal to see what I mean)? Or is there any workaround?

Any help is welcome

Nelson

P.S.: Sorry for my bad English, I am just a 16 yo old guy from Germany ;)

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.