You are here: Re: fopen permissions « All PHP « IT news, forums, messages
Re: fopen permissions

Posted by Jim Michaels on 02/27/06 09:15

"Jim Michaels" <NOSPAMFORjmichae3@yahoo.com> wrote in message
news:mZOdnQzK_JPfA5_ZnZ2dnUVZ_tCdnZ2d@comcast.com...
> set setting umask(0) first.
> saw this in another post.

http://us3.php.net/manual/en/function.umask.php (read this for how to
restore the umask)
http://www.opengroup.org/onlinepubs/009695399/functions/umask.html (helpful
info) It says that bit positions that are set in the cmask (the umask()
parameter) are cleared in the created file/dir.
so their umask is probably something wrong. (or very very secure)

What does the OS do with the umask when it creates a directory/file - ORs or
ANDs with your permissions value or what? based on that 2nd link info
above, the OS does a created=permissionRequest&~umask.
the rationale is: it's easier to represent as set bits in octal what you
want to clear.
if you want a 0755 directory, the you would use a 022 umask to clear the
bits at positions 022.

don't forget to put the 0 in front of the number to get octal, or you are
going to get some pretty weird permissions!
755=01363 (clearly a special file - a nono in UNIX)
777=01411 (again... a mess)

>
> "sam" <slowcoachis@sbcglobal.net> wrote in message
> news:Vg6Lf.11414$rL5.10965@newssvr27.news.prodigy.net...
>> Cmac wrote:
>>> 701 or 755 should work fine, who is the owner of said directory?
>>>
>>
>> neither work. If the file already exists, 755 works. but creation seems
>> to be locked down for some reason.
>> sam is owner, if i change folder to 777, and run the script, the file
>> that gets created is owned by nobody as expected.
>>
>> the host is assortedinternet.com
>>
>> sam
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация