Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Chmody ?!
Forum PHP.pl > Forum > PHP
djbarca
mam pytanko da sie jakos zrobic zeby pokazalo mi chmody danego katalogu np grafika
chcialbym tak jak jest w cutenews ... przy samym wejsciu jest czy jest dostep np jak jest 777 to mi wyswietli TAK

to to juz sam sobie zrobie tylko jak wyswietlic jakie sa chmody dla danego katalogu np te 777
tsharek
nie testowałem, ale z manuala do chmoda w komentarzach było coś takiego:
  1. <?php
  2. function getmod($filename) {
  3. $val = 0;
  4. $perms = fileperms($filename);
  5. // Owner; User
  6. $val += (($perms & 0x0100) ? 0x0100 : 0x0000); //Read
  7. $val += (($perms & 0x0080) ? 0x0080 : 0x0000); //Write
  8. $val += (($perms & 0x0040) ? 0x0040 : 0x0000); //Execute
  9.  
  10. // Group
  11. $val += (($perms & 0x0020) ? 0x0020 : 0x0000); //Read
  12. $val += (($perms & 0x0010) ? 0x0010 : 0x0000); //Write
  13. $val += (($perms & 0x0008) ? 0x0008 : 0x0000); //Execute
  14.  
  15. // Global; World
  16. $val += (($perms & 0x0004) ? 0x0004 : 0x0000); //Read
  17. $val += (($perms & 0x0002) ? 0x0002 : 0x0000); //Write
  18. $val += (($perms & 0x0001) ? 0x0001 : 0x0000); //Execute
  19. // Misc
  20. $val += (($perms & 0x40000) ? 0x40000 : 0x0000); //temporary file (01000000)
  21. $val += (($perms & 0x80000) ? 0x80000 : 0x0000); //compressed file (02000000)
  22. $val += (($perms & 0x100000) ? 0x100000 : 0x0000); //sparse file (04000000)
  23. $val += (($perms & 0x0800) ? 0x0800 : 0x0000); //Hidden file (setuid bit) (04000)
  24. $val += (($perms & 0x0400) ? 0x0400 : 0x0000); //System file (setgid bit) (02000)
  25. $val += (($perms & 0x0200) ? 0x0200 : 0x0000); //Archive bit (sticky bit) (01000)
  26. return $val;
  27. }
  28. ?>


ogólnie to fileperms" title="Zobacz w manualu PHP" target="_manual
djbarca
ok . thx smile.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.