b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » Message 3287821 (Thread)

# can i tj with a quick technical question
is it possible to change file permissions from within a php script?
(, Fri 4 Jun 2004, 23:21, archived)
# I don't know
but it's a trivial matter in Perl
(, Fri 4 Jun 2004, 23:23, archived)
# perl makes me sad though
(, Fri 4 Jun 2004, 23:26, archived)
# perl is evil
oh yes.

perl regexs are nice though.
(, Fri 4 Jun 2004, 23:27, archived)
# It makes me happy
when I finally manage to get it to work
(, Fri 4 Jun 2004, 23:31, archived)
# I don't know.. But what I DO know is that I like chocolate biscuits..
Huzzah!
(, Fri 4 Jun 2004, 23:23, archived)
# me too
What a kwinky-dinky
(, Fri 4 Jun 2004, 23:24, archived)
# me too
What a kwinky-dinky
(, Fri 4 Jun 2004, 23:24, archived)
# yep
uk.php.net/manual/en/function.chmod.php

watch out for the umask gotcha, it works a bit differently to chmod on the command line.
(, Fri 4 Jun 2004, 23:26, archived)
# cheers muchly
i really ought to have looked for that function name... silly me
(, Fri 4 Jun 2004, 23:29, archived)
# add a 0 before the normal mode
so:

chmod( 'filename', 0755 );

is equiv to

bash$ chmod 755 filename
(, Fri 4 Jun 2004, 23:33, archived)
# cheers!
*duely notes*
(, Fri 4 Jun 2004, 23:36, archived)