Forum Moderators: coopster

Message Too Old, No Replies

PHP file permissions

         

andrewsmd

12:22 pm on Oct 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there any way to get and change the permissions of files with PHP. I.E.
$permission = theFilePermssion();
and changeFilePermission($someFileName);
Just wondering?
Thanks,

coopster

1:46 pm on Oct 10, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



stat() [php.net]
lstat() [php.net]
fstat() [php.net]
filemtime() [php.net]
filegroup() [php.net]

chmod() [php.net]
chown() [php.net]
chgrp() [php.net]

andrewsmd

2:06 pm on Oct 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok so the chmod command I have used before in Linux, but I am on a windows machine bascially what I need to do is change a file from read only to not read only (the same thing as right clicking and going to properties and unchecking the box). Any idea on how I use the chmod function to do this.

[edited by: andrewsmd at 2:26 pm (utc) on Oct. 10, 2008]

coopster

2:14 pm on Oct 10, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Some will. You'll find details for every command on the PHP manual page. Look for "Note" and terminology like that that for operating system specific differences.