Reply to Re: [PHP] is_dir paths

Your name:

Reply:


Posted by Ondrej Ivanič on 09/26/05 16:37

Mark Rees wrote:
> That outputs (paths trimmed)
>
> string(56) "C:\...\htdocs\lists\admin"
> string(61) "C:\...\htdocs\lists\admin\temp"
> bool(false)
>
> var_dump (realpath("../../lists/admin/temp"));
>
> this outputs the same as
>
> var_dump (realpath('temp'));
> I am trying to check whether /lists/admin/temp exists (which it does).

This dir doesn't exists. The '/' at the beginning of path means: path is
from root (unix) or from e.g. c:\ (windows)

Outputs from

var_dump(realpath("../../lists/admin/temp"))
var_dump(realpath('temp'));

are same and thus you working directory is 'C:\...\htdocs\lists\admin'.
If you need check existence of dir 'temp' in your current working
directory you can try one of:

is_dir('temp');
is_dir('./temp');
is_dir('C:\...\htdocs\lists\admin\temp');

IMHO every is_dir() return true.

--
Ondrej Ivanč
(ondrej@zlty-pes.sk)

[Back to original 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

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