On Wednesday, Sep 17, 2003, at 18:50 US/Pacific, ram Osuri wrote:


I agree with your assesment .. to solve this problem you might want to do a

chmod 777 newfile.txt and then run the program it will work then

Actually there are two problems with this.


a. there is no reason to set the execute bits,
        chmod 666 would work fine enough - there is also
        the problem that the file would have to exist.

b. if the problem is that the directory where the file
        is to be created does not allow the user to write to
        begin with, then the chmod will fail.

to demonstrate I created a directory and chown'd it to
user admin, so even those I and admin are in the same
group, I can not create files in the directory because
only the user admin has write permission on the directory.

eg:
[jeeves: 3:] ls -ltra
total 0
drwxrwxrwx  29 drieux  house  986 Sep 17 15:59 ..
drwxr-xr-x   2 admin   house   68 Sep 17 15:59 .
[jeeves: 4:] touch file
touch: file: Permission denied
[jeeves: 5:] chmod 777 file
chmod: file: No such file or directory
[jeeves: 6:] chmod 777 file
chmod: file: Operation not permitted
[jeeves: 7:] ls -l
total 0
-rw-r--r--  1 admin  house  0 Sep 17 16:01 file
[jeeves: 8:] perl -e 'open(FD, ">file") or die "file :$!"; '
file :Permission denied at -e line 1.
[jeeves: 9:]

note between command 5 and 6, I did a touch of the the file 'file'
so that it would exist and show you the problem of the chmod
on the existing file I did not have permission to write to...

HTH.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to