in reply to File permissions problems
I believe the problem is in chmod($mode, '$topdir/$dir'). Because the directory name is single-quoted, those variables are not interpolated, e.g., their real values are not substituted into the string. Instead, they are treated as literal strings and therefore you're actually trying to set the permissions on a directory named '$topdir/$dir', not the one you want. Then later, when you try to write a file into your target directory, you'll get a 'permission denied' because that directory has not been made user writeable. Try double-quoting the variables constituting the directory name, as in chmod($mode, "$topdir/$dir").
You can also check the value of $! after a chmod call to see what happened. In this case warn $! if $! yields 'No such file or directory'.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: File permissions problems
by tedrek (Pilgrim) on Nov 02, 2002 at 03:39 UTC |