You are here: Re: filtype() Problems « PHP Programming Language « IT news, forums, messages
Re: filtype() Problems

Posted by Kevin Cloutier on 12/30/05 15:26

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.
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация