> Hi, > > Much to my surprise, when I run this code, it never returns 0 if it could not > carry out the operation. > > $rc = $f->site("chmod 666 $remoteFile") > or die "ftp: Could not change permissions: $!\n"; > > It seems to return a 2 on success, and a 5 if it could not access the file > because of a different owner. > > My question is, what return code can I rely on? I need to be sure the > permissions were set to '666'. > > Any suggestions? This is a emergency "quick fix". > > Thanks in advance....
>From the docs: "Returns most significant digit of the response code." The response code is part of the FTP specification, response codes in the 200's are successes and responses in the 500's are failures, so it should be sufficient to check for a 2 and have that be success, a 5 makes failure and anything else is undefined. By looking at the 2 lesser significant digits normally a failure cause can be determined, but with 'site' that is system dependent (at least I think). HTH, http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]