Tema: mkdir
Pogledajte određenu poruku
Staro 06. 06. 2008.   #4
japan
novi klan
Professional
 
Avatar japan
 
Datum učlanjenja: 03.02.2007
Poruke: 326
Hvala: 43
427 "Hvala" u 50 poruka
japan će postati "faca" uskorojapan će postati "faca" uskorojapan će postati "faca" uskorojapan će postati "faca" uskorojapan će postati "faca" uskoro
Default

da, to je ocekivano ponasanje, potpuno analogno sa *nix sistemskim pozivima. mkdir('ime_fajla', 0777) je isto sto i mkdir('ime_fajla'), samo sto je u prvom slucaju maska 0777 eksplicitno navedena, a u drugom je podrazumevana.

evo sta kaze man za mkdir sistemski poziv:

Citat:
int mkdir(const char *pathname, mode_t mode);

DESCRIPTION

mkdir() attempts to create a directory named pathname.

The parameter mode specifies the permissions to use. It is modified by
the process's umask in the usual way: the permissions of the created
directory are (mode & ~umask & 0777). Other mode bits of the created
directory depend on the operating system. For Linux, see below.
a umask vrednost se uzima u obzir samo kod poziva koji kreiraju fajlove.

i opet linux man:

Citat:
mode_t umask(mode_t mask);

DESCRIPTION

umask() sets the calling process's file mode creation mask (umask) to
mask & 0777.

The umask is used by open(2), mkdir(2), and other system calls that
create files to modify the permissions placed on newly created files or
directories. Specifically, permissions in the umask are turned off
from the mode argument to open(2) and mkdir(2) (so, for example, the
common umask default value of 022 results in new files being created
with permissions 0666 & ~022 = 0644 = rw-r--r-- in the usual case where
the mode is specified to open(2) as 0666).
a chmod ne uzima vrednost u obzir, zato uvek dozvole promeni na navedene
__________________
We professional we dealin' with business
japan je offline   Odgovorite uz citat