發新話題

[分享] 《PHP》『檔案系統函式庫』

《PHP》『檔案系統函式庫』touch --- 設定檔案的修改時間

touch

(PHP3 , PHP4)

touch ---  設定檔案的修改時間

語法 : int touch (string filename [, int time])

說明 :

試著去設定檔案filename的修改時間,如果選項time沒有給予,則使用目前的時間。

如果檔案不存在,它將會建立一個檔案。

成功則傳回true,否則傳回false。

Example :

<?php

    if (touch ($FileName)) {

          print "$FileName modification time has been  changed to todays date and time";

    } else {

              print "Sorry Could Not change modification time of $FileName";
       }

?>


TOP

《PHP》『檔案系統函式庫』umask --- 改變目前的umask

umask

(PHP3 , PHP4)

umask ---  改變目前的umask

語法 : int umask (int mask)

說明 :

umask( )設定PHP的umask為mask & 0777,並傳回舊的umask。當PHP是使用伺服器模組時,各個請求完成時umask會恢復(restored)。

umask( )無任何參數則簡單的傳回目前的umask。

TOP

《PHP》『檔案系統函式庫』unlink --- 刪除檔案

unlink

(PHP3 , PHP4)

unlink ---  刪除檔案

語法 : int unlink (string filename)

說明 :

刪除檔案filename,類似於Unix C unlink( )。

錯誤則傳回0或是false。

注意 : 此函式可能無法運作在Windows系統

參考 : rmdir( )

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。