Position actuelle: Accueil> Catégories de fonctions> chmod

chmod

Modifier le mode fichier
Nom:chmod
Catégorie:Système de fichiers
Langage de programmation:php
Description en une ligne:Modifier le mode fichier.

Exemple

 <span class="token php language-php"><span class="token delimiter important"><? Php</span>
<span class="token comment">// Le propriétaire peut lire et écrire, et d&#39;autres n&#39;ont aucune autorisation</span>
<span class="token function">chmod</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token number">0600</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>

<span class="token comment">// Le propriétaire peut lire et écrire, et d&#39;autres peuvent lire</span>
<span class="token function">chmod</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token number">0644</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>

<span class="token comment">// Le propriétaire a toutes les autorisations, qui peuvent être lues et exécutées par tout le monde</span>
<span class="token function">chmod</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token number">0755</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>

<span class="token comment">// Le propriétaire a toutes les autorisations, et le groupe où le propriétaire est situé peut être lisible</span>
<span class="token function">chmod</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token number">0740</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>
Fonctions similaires
  • Déterminez si le nom de fichier donné est une connexion symbolique is_link

    is_link

    Déterminezsilenomdef
  • Créer une connexion difficile link

    link

    Créeruneconnexiondif
  • Déterminez si le fichier existe et est lisible is_readable

    is_readable

    Déterminezsilefichie
  • Fermez un pointeur de fichier ouvert fclose

    fclose

    Fermezunpointeurdefi
  • Créer un fichier temporaire tmpfile

    tmpfile

    Créerunfichiertempor
  • Faire correspondre les noms de fichiers avec le modèle fnmatch

    fnmatch

    Fairecorrespondreles
  • Changer le umask actuel umask

    umask

    Changerleumaskactuel
  • Tronquer le fichier sur une longueur donnée ftruncate

    ftruncate

    Tronquerlefichiersur