Date: 01/15/01
- Next message: sniper <email protected>: "[PHP-DEV] PHP 4.0 Bug #8718 Updated: unexpected Network Error can't display document"
- Previous message: Stig Venaas: "Re: [PHP-DEV] PHP 4.0 Bug #8721: compile problem on glibc-2.2.1"
- In reply to: Sergio Bruder: "[PHP-DEV] Shouldn't copy() preserve file permissions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This is the system at work you will have to use copy & chmod/chown.
If I understand it correctly the creat() C function takes the permissions
given (0777 in PHP's case) and subtracts the umask value from it. So as
root on my system my umask is 0022, which means I will end up with 0777 -
0022 which gives me permissions of 0755. A sample script confirms this.
[root <email protected> php-4.0.4]# umask
022
[root <email protected> php-4.0.4]# ls -la php
-rw------- 1 root root 2346277 Jan 13 23:12 php
[root <email protected> php-4.0.4]# cat tmp.php
<? copy("php","php2"); ?>
[root <email protected> php-4.0.4]# php -q tmp.php
[root <email protected> php-4.0.4]# ls -la php2
-rwxr-xr-x 1 root root 2346277 Jan 15 14:49 php2
Chris
----- Original Message -----
From: "Sergio Bruder" <bruder <email protected>>
To: <php-dev <email protected>>
Sent: Monday, January 15, 2001 2:05 PM
Subject: [PHP-DEV] Shouldn't copy() preserve file permissions?
> I have a /tmp/file mode 0600, and used php4's
> copy('/tmp/file','tmp/file-copy'), and /tmp/file-copy got 0662 permission.
>
> Shouldn't it be 0600 as well, or should I use another function to get this
> behaviour?
>
> Sergio Bruder
>
> --
> ( http://distro.conectiva.com.br
> )) (tm) http://sergio.bruder.net
> |""|-. http://pontobr.org
> |__|-' bruder <email protected>, sergio <email protected>
> --------------------------------------------------------------------------
---- > pub 1024D/0C7D9F49 2000-05-26 Sergio Devojno Bruder <bruder <email protected>> > Key fingerprint = 983F DBDF FB53 FE55 87DF 71CA 6B01 5E44 0C7D 9F49 > sub 1024g/138DF93D 2000-05-26 > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe <email protected> > For additional commands, e-mail: php-dev-help <email protected> > To contact the list administrators, e-mail: php-list-admin <email protected> >-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: sniper <email protected>: "[PHP-DEV] PHP 4.0 Bug #8718 Updated: unexpected Network Error can't display document"
- Previous message: Stig Venaas: "Re: [PHP-DEV] PHP 4.0 Bug #8721: compile problem on glibc-2.2.1"
- In reply to: Sergio Bruder: "[PHP-DEV] Shouldn't copy() preserve file permissions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

