Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]filesize + filemtime = stat failed
elewator
post
Post #1





Grupa: Zarejestrowani
Postów: 63
Pomógł: 1
Dołączył: 30.07.2008
Skąd: Ustka

Ostrzeżenie: (0%)
-----


Witam. Mam skrypcik, który mi pokazuje liste plików w katalogu. Wszystko pięknie, lecz gdy chciałem dodać rozmiar+czas dodania pliku, pojawiają się błędy:
Kod
Warning: filesize() [function.filesize]: stat failed for xxxx in /home/amaru/public_html/lista.php on line 22

Warning: filemtime() [function.filemtime]: stat failed for xxxx in /home/amaru/public_html/lista.php on line 22

Plik lista.php:
  1. <?
  2. $i = 0;
  3.  
  4. $images['file'] = '<img src="img/plik.gif"> ';
  5. function show_dir($directory)
  6. {
  7. global $i, $images;
  8.  
  9. $dir = opendir($directory);
  10. while ( $file = readdir($dir) )
  11. {
  12. if ( $file != '.' && $file != '..' )
  13. {
  14. if ( is_dir($directory.'/'.$file) )
  15. {
  16. echo ( str_repeat(' ', $i * 2) . $file . '<br>' );
  17. ++$i;
  18. show_dir($directory . '/' . $file);
  19. }
  20. else
  21. {
  22. echo ( str_repeat(' ', $i * 4) . $images['file'] . "<a href=\"pliki/$file\">$file</a>" . filesize($file) . filemtime($file) . '<br />');
  23. }
  24. }
  25. }
  26. closedir($dir);
  27. --$i;
  28. }
  29.  
  30. show_dir('pliki/');
  31.  
  32. ?>

Mam nadzieję, że razem podołamy temu problemowi tongue.gif Pozdrawiam.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 16:06