stat 
array stat ( string $filename )
Podaje statystyki pliku o nazwie podanej w parametrze $filename,
Podaje statystyki pliku o nazwie podanej w parametrze $filename,
Gathers the statistics of the file named by    filename .
Parametry
-  filename         - Ścieżka do pliku
-  
Zwracane wartości
| NUmer | wartosc | opis | 
|---|---|---|
| 0 | dev | numer urządzenia | 
| 1 | ino | numer węzła | 
| 2 | mode | węzeł w trybie ochrony | 
| 3 | nlink | liczba dowiązań | 
| 4 | uid | userid właściciela | 
| 5 | gid | grupa właścicieli * | 
| 6 | rdev | typ urządzenia | 
| 7 | size | rozmiar w bajtach | 
| 8 | atime | ostatni czas dostępu | 
| 9 | mtime | ostatni czas modyfikacji | 
| 10 | ctime | ostatni czas zmiany wezła | 
| 11 | blksize | blocksize of filesystem IO ** | 
| 12 | blocks | ilosć alokacji bloków | 
Listing
//Przykład #1 stat() example
<?php
/* pobieramy statystyki plików */
$stat = stat('C:\php\php.exe');
/*
* Print file access file, this is the same
* as calling fileatime()
*/
echo 'Access time: ' . $stat['atime'];
/*
* Print file modification time, this is the
* same as calling filemtime()
*/
echo 'Modification time: ' . $stat['mtime'];
/* Print the device number */
echo 'Device number: ' . $stat['dev'];
//Przykład #2 Using stat() information together with touch()
<?php
/* Get file stat */
$stat = @stat('C:\php\php.exe');
/* Did we failed to get stat information ? */
if(!$stat)
{
echo 'Stat call failed...';
}
else
{
/*
* We want the access time to be 1 week
* before the current access time.
*/
$atime = $stat['atime'] + 604800;
/* Touch the file */
if(!@touch('some_file.txt', time(), $atime))
{
echo 'Failed to touch file...';
}
else
{
echo 'Touch returned success...';
}
}
?>
Dodano przez: igor  
Ranga: Administrator serwisu Punktów: 0
Ranga: Administrator serwisu Punktów: 0
Komentarze użytkowników
:: Losowe artykuły 

:: Wymiana linków 
    
	Modowe inspiracje |
        Android Gry i Aplikacje |
        ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
        Logo dla firmy |
        Change Tires - Car Weather Forecast Reminder |
        Laminas: MVC Framework for PHP |
        IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS | 
        Katalog roślin |
        Programming articles: JAVA, PHP, C++, Python, JavaScript |
        Kancelaria Adwokacka Łukasz Huszno
        
    

 
  
				

 
                             
 


 
                        
 
		 
	