Thanks again, John. That was the problem and the if test fixed it.Rodney Green wrote: <snip>
Actually, I'm not having problems with that. The whitespace is still there in between the commands and arguments, etc. I'm using fgets , not fread. Not sure what the difference between the two is but I'll check it out. The problem I am having however is that at the end of the shell script that is created it puts an additional line. It writes the chown command line for all of the users then puts the following line with no user specified.
chown :html /var/spool/mail/
The other lines show up as: chown rgreen:html /var/spool/mail/rgreen chown rgreen01:html /var/spool/mail/rgreen01 chown rod:html /var/spool/mail/rod
Any ideas where that extra line is coming from?
thanks again, Rod
Is there a carriage return (new line) after the last entry in your text file?
You can add an if test in there to stop this...
$buffer = rtrim ( $handle[$i] );
if ( $buffer != "" ) {
fwrite ($fhandle, "chown $buffer:html /scripts/var/spool/mail/$buffer\n", 4096);
}
Rod
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php