Re: Re: File or directory?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



is_dir()

<http://ca3.php.net/is_dir>

is_file()

<http://ca3.php.net/manual/en/function.is-file.php>

George Langley


On 15-Aug-09, at 5:45 PM, Clancy wrote:

On Sat, 15 Aug 2009 10:33:07 +0100, ash@xxxxxxxxxxxxxxxxxxxx (Ashley Sheridan) wrote:

On Sat, 2009-08-15 at 09:56 +0200, Ralph Deffke wrote:
can u upload ur own files ?
can u create a directory ?

Yes.

are u using a ftp client ?

No; I'm using straight PHP FTP


"Clancy" <clancy_1@xxxxxxxxxxxx> wrote in message
news:kjhc85hpub7drihgappifphcboolt9udmc@xxxxxxxxxx
I have just got access to a new server, and am playing with
upload/download procedures. I
looked in the root directory, and see several objects which I assume to be
directories.
However I was surprised to find there does not appear to be any command to
determine if an
object is a file or directory, either in PHP FTP or plain FTP. I could
try to change to
them, or download them, but this seems overkill.  Am I overlooking
something obvious?



That answer doesn't seem to quite come close even to answering the op
question.

Have you looked at ftp_rawlist which returns a detailed list of files,
along with their permissions and directory flags? Or you could use
ftp_size to determine the size of a file, which should be nothing for a
directory.

Thanks,

Yes; I found ftp_rawlist eventually, but I still haven't found a definition of the return
code, though I think I know most of it.

I guess that even a null file will hve some length? I will probably use the leading 'd'
in the return code to test for directories..

(And I spent a long time trying to work out how 'drwxr-xr-x 2 riordan riordan 512 Jul 31 06:40 cgi-bin' could contain lots of spaces, before I remembered that, as a result of one
of the weirder design decisions,  HTML suppresses trailing spaces.)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux