On 4/24/07, dev@xxxxxxxxxx <dev@xxxxxxxxxx> wrote:
This question is a two parter.... a) anyone else noticing filetype() failing on ISO image files? Warning: filetype(): Lstat failed for /var/lib/samba/some/file.iso
Nope, didn't fail for me. But what exactly do you want to know about the file? filetype only check wheter the the argument given is a fifo, char, dir, block, link, file, or unknown. What you're doing below with the file command is getting the content type, there you could use the function mime_content_type, but it is deprecated, and seems not to work always. The manual forwards you to the fileinfo functions: http://www.php.net/manual/en/function.finfo-file.php example 592 does what you're doing with the file command below.
b) I have a script that during processing will eventually call exec('/usr/bin/file -bi '.$file) over 1000 times, I've added a counter and when it dies on this line it's always after 1020 exec calls, regardless of the file name I'm feeding to `file`. I've reproduced this with both exec, shell_exec, system and the backticks. What am I missing here?
Why does it die? Is it because te max execution time reached? then you should extend the max executon time: http://www.php.net/set_time_limit Tijnema <snip> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php