RE: [PHP] filetype() and exec() issues

From: Date: Tue, 24 Apr 2007 06:32:10 +0000
Subject: RE: [PHP] filetype() and exec() issues
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-253563@lists.php.net to get a copy of this message
You may also want to check and make sure that your ISO isn't more than 4GB. IIRC, I had some troubles with extremely large files and using filetype() on them. But then again, it may have just been something on my own end. -Logan -----Original Message----- From: Tijnema ! [mailto:tijnema@gmail.com] Sent: Tuesday, April 24, 2007 2:18 AM To: dev@edoceo.com Cc: php-general@lists.php.net Subject: Re: [PHP] filetype() and exec() issues On 4/24/07, dev@edoceo.com <dev@edoceo.com> 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

« previous php.general (#253563) next »