Re: filtype() Problems
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: filtype() Problems

From: Kevin Cloutier <Not_AN_EMAIL@mathworks.com>
Date: Fri Dec 30 2005 - 14:26:37 CET

Hi Jeff,

Thanks for the help. For now I have found a work around. For some reason
this is only effecting some of the files and not any directories. So,
instead of using filetyp()=='file' it dawned on me to use !='dir'. That
seems to work fine for my needs.

But you're right about error messaging, as you can tell I'm still new at
this so I will have to investigate turning this on today.

With that said, this is completely baffling. For the files that don't
produce a type I don't see anything printed to the screen. Maybe a NULL
value is returned? I wonder if I can check that? But it gets stranger.

At first I thought it was a problem with my for loop. But if I "copy"
the files that do give a type, and place the copies in the same
directory (i.e. "file.txt" copied to "copy_file.txt"), they DO give a
type. So it's not the loop.

I've tried this on a Mac, Windows IIS and Linux, so strange. But I'll
see what I find in the error logs.

Again, thanks for the help,

Kevin

Jeff Johns wrote:
> Are you not getting anything in return for the files that do not
> produce a type?
>
>>>From the manual:
> "Returns FALSE if an error occurs. filetype() will also produce an
> E_NOTICE message if the stat call fails or if the file type is
> unknown."
>
> Set your error reporting for the script to report all errors to try an
> pinpoint what is happening. It is hard to tell not seeing the rest of
> the script and your filesystem.
>
Received on Tue Jan 3 03:50:19 2006