Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Chmody ?!
djbarca
post 6.09.2007, 10:04:57
Post #1





Grupa: Zarejestrowani
Postów: 231
Pomógł: 1
Dołączył: 22.04.2007
Skąd: Rypin

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


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
Go to the top of the page
+Quote Post
tsharek
post 6.09.2007, 10:46:51
Post #2





Grupa: Zarejestrowani
Postów: 300
Pomógł: 1
Dołączył: 22.09.2003
Skąd: Czeladź

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


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

Ten post edytował tsharek 6.09.2007, 10:48:06


--------------------
Go to the top of the page
+Quote Post
djbarca
post 6.09.2007, 13:33:31
Post #3





Grupa: Zarejestrowani
Postów: 231
Pomógł: 1
Dołączył: 22.04.2007
Skąd: Rypin

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


ok . thx smile.gif
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 - 04:54