>  Sorry -- actually I meant that (along similar lines), there was a program 
>  with the following lines:
> 
>  vsystem("/bin/chmod +x %s", filename);
> 
>  and I replaced it with:
> 
>  chmod(filename, (mode_t) ( S_IXUSR | S_IXGRP | S_IXOTH ));

Those two lines have different effects.  The first adds the execute bit
to the file.  The second replaces the current permissions with only the
execute bit.  To have the same affect, you need to stat() the file,
and then use bitwise-or to add the S_IXUSR | S_IXGRP | S_IXOTH bits to
st_mode and use that new st_mode with chmod().
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to