Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Jak sprawdzić chmod
terreska
post 7.08.2006, 17:16:42
Post #1





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 23.07.2006

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


Poszukałam troche i znalazłam jak zmienić chmody, mianowicie trzeba użyć funkcji chmod().
Jakiej funkcji należy użyć, aby sprawdzić jaki chmod jest ustawiony dla pliku?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
strife
post 7.08.2006, 17:37:13
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 605
Pomógł: 96
Dołączył: 22.10.2004
Skąd: UK

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


fileperms" title="Zobacz w manualu php" target="_manual


--------------------
Go to the top of the page
+Quote Post
terreska
post 7.08.2006, 19:59:29
Post #3





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 23.07.2006

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


Dziękuję.

Mam następujący skrypcik:
  1. <?
  2. $katalog="test";
  3. if (is_dir($katalog)) 
  4. {
  5. echo '<center>Chmod katalogu ' .$katalog;
  6. if (fileperms($katalog)==16868)
  7. {
  8. echo '<font color="green"> - prawidlowy.<br></font>';
  9. }
  10. else
  11. {
  12. echo '<font color="red"> nieprawidlowy.<br></font></center>';
  13. }
  14. }
  15. else
  16. {
  17. echo '<font color="red"><center>Brak katalogu ' .$katalog .fileperms($katalog).'<br></font></center>';
  18. }
  19. //
  20. $katalog="test/test2";
  21. if (is_dir($katalog)) 
  22. {
  23. echo '<center>Chmod katalogu ' .$katalog;
  24. if (fileperms($katalog)==33279)
  25. {
  26. echo '<font color="green"> - prawidlowy.<br></font>';
  27. }
  28. else
  29. {
  30. echo '<font color="red"> nieprawidlowy.<br></font></center>';
  31. }
  32. }
  33. else
  34. {
  35. echo '<font color="red"><center>Brak katalog ' .$katalog .fileperms($katalog).'<br></font></center>';
  36. }
  37. ?>


Chmod katalogu test sprawdza, natomiast ścieżki test/test2 już nie, wywala błąd:
Warning: is_dir(): Stat failed for test/test (errno=13 - Permission denied)

Jak to poprawić?
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 06:21