Autor | Zpráva | ||
---|---|---|---|
Jan Tvrdík Profil |
#1 · Zasláno: 10. 6. 2009, 22:08:47
Lze pomocí PHP nějak zjistit, zda je soubor ve windowsech skrytý?
|
||
bohyn Profil |
#2 · Zasláno: 11. 6. 2009, 03:24:49
Jan Tvrdík
Specialni funkci na to neznam, ale tohle by melo fungovat. Mozna bude treba oriznout z $out bile znaky. $file = "soubor"; $out = `dir $file /ah /b`; if($out == $file) { echo "{$file} je skryty soubor"; } |
||
Jan Tvrdík Profil |
#3 · Zasláno: 11. 6. 2009, 15:29:42 · Upravil/a: Jan Tvrdík
bohyn:
EDIT: Už jsem přišel na to, co měl ten tvůj nefunkční fragment kódu dělat. Takže pro ty co hledají: function isFileHidden($file) { if (!is_file($file)) { throw new Exception("Soubor '$file' nebyl nalezen."); } exec('dir /ah /b', $hiddenFiles); return in_array($file, $hiddenFiles); } nebo alternativně: function isFileHidden($file) { if (!is_file($file)) { throw new Exception("Soubor '$file' nebyl nalezen."); } exec("dir $file /ah /b", $output); return (isset($output[0])); } Díky za inspiraci k řešení. |
||
bohyn Profil |
#4 · Zasláno: 11. 6. 2009, 18:26:46
Jan Tvrdík
„Už jsem přišel na to, co měl ten tvůj nefunkční fragment kódu dělat.“ mozna jsi narazil na omezeni safe_mode. Pri safe_mode off by to melo byt funkcni. |
||
Časová prodleva: 15 let
|
0