Current Location: Home> Function Categories> fileperms

fileperms

Obtain file permissions
Name:fileperms
Category:File system
Programming Language:php
One-line Description:Returns permissions to the file.

Example

Example 1

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">fileperms</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

Output:

 33206

Example 2

Return permissions as octal values:

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">substr</span> <span class="token punctuation">(</span> <span class="token function">sprintf</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"%o"</span> <span class="token punctuation">,</span> <span class="token function">fileperms</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">)</span> <span class="token punctuation">)</span> <span class="token punctuation">,</span> <span class="token operator">-</span> <span class="token number">4</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

Output:

 1777
Similar Functions
  • Close process file pointer pclose

    pclose

    Closeprocessfilepoin
  • Provide information about the document stat

    stat

    Provideinformationab
  • Returns the location where the file pointer is read/write ftell

    ftell

    Returnsthelocationwh
  • Create a hard connection link

    link

    Createahardconnectio
  • Create a file with a unique file name tempnam

    tempnam

    Createafilewithauniq
  • Read a line from a file pointer fgets

    fgets

    Readalinefromafilepo
  • Returns the available space on the file system or disk partition disk_free_space

    disk_free_space

    Returnstheavailables
  • Get information about a connection linkinfo

    linkinfo

    Getinformationabouta
Popular Articles