Re: [PHP] is_dir reading a folder with a space in the name?

2007-02-08 Thread T.Lensselink
:) You are right about the robustness part.. The directory i made by hand. So no need to create and remove it with code. And using a test suit to show this simple example seems like a bit of overkill to me. Just wanted to show directories with spaces function properly when used with is_dir(). Ro

Re: [PHP] is_dir reading a folder with a space in the name?

2007-02-08 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-08 16:14:57 +0100: > Like Roman said. I also don't see this behaviour. > Although my test is a lot more simple :) It's not complete: > $dir = "test dir"; mkdir($dir); > if (is_dir($dir)) { > echo "It's a dir :)"; > } rmdir($dir); But even with those two c

Re: [PHP] is_dir reading a folder with a space in the name?

2007-02-08 Thread T . Lensselink
Like Roman said. I also don't see this behaviour. Although my test is a lot more simple :) On Thu, 08 Feb 2007 17:24:33 +0200, Angelo Zanetti <[EMAIL PROTECTED]> wrote: > its running on a linux server PHP 4.3.x > > What i mean is that the directory name has a space in it eg: > srv/www/htdocs/si

Re: [PHP] is_dir reading a folder with a space in the name?

2007-02-08 Thread Angelo Zanetti
its running on a linux server PHP 4.3.x What i mean is that the directory name has a space in it eg: srv/www/htdocs/site/Broker details/ T.Lensselink wrote: OS? PHP version? Tested with PHP4 on Win and *nix : works On Thu, 08 Feb 2007 16:47:26 +0200, Angelo Zanetti <[EMAIL PROTECTED]>

Re: [PHP] is_dir reading a folder with a space in the name?

2007-02-08 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-08 16:47:26 +0200: > I am reading directories and one of the directories has a space in it so > when I run: > > if (is_dir($dir)) > > it returns false. How much space? You need at least 1GB. But seriously, I don't see the behaviour you mention: d = $this->mkdtemp(

Re: [PHP] is_dir reading a folder with a space in the name?

2007-02-08 Thread T . Lensselink
OS? PHP version? Tested with PHP4 on Win and *nix : works On Thu, 08 Feb 2007 16:47:26 +0200, Angelo Zanetti <[EMAIL PROTECTED]> wrote: > Hi All. > > > I am reading directories and one of the directories has a space in it so > when I run: > > if (is_dir($dir)) > > > it returns false. But I

[PHP] is_dir reading a folder with a space in the name?

2007-02-08 Thread Angelo Zanetti
Hi All. I am reading directories and one of the directories has a space in it so when I run: if (is_dir($dir)) it returns false. But I know the folder exists, so is there a way to force the read? Or what else should I do? rename it and then read it? Thanks in advance. -- --

Re: [PHP] is_dir paths

2005-09-26 Thread Mark Rees
> echo '', var_dump( $_SERVER ), ''; > > for instance I cut/paste the following from an application of my, > the code lives in a centrally included file: > > /* define a webroot basepath for the datasyncer module */ > define('DS_WEBROOT', realpath(dirname(__FILE__).'/..')); > dirname! That's the

Re: [PHP] is_dir paths

2005-09-26 Thread Jochem Maas
Mark Rees wrote: 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")

Re: [PHP] is_dir paths

2005-09-26 Thread Mark Rees
> > 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")) >

Re: [PHP] is_dir paths

2005-09-26 Thread Ondrej Ivanič
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/t

Re: [PHP] is_dir paths

2005-09-26 Thread Mark Rees
> > > what does the following output: > > > > > > var_dump (getcwd()); Sorry, this wasn't clear. I mean it outputs c:\...\htdocs\lists\admin Not sure about the permissions. I'm using windows 2000, and the 'temp' directory has the same user permissions as the rest of the htdocs folder > > what

Re: [PHP] is_dir paths

2005-09-26 Thread Mark Rees
> > what does the following output: > > > > var_dump (getcwd()); This outputs a fully qualified path to the current working directory (/lists/admin) Not sure about the permissions. I'm using windows 2000, and the 'temp' directory has the same user permissions as the rest of the htdocs foler > >

[PHP] is_dir paths

2005-09-26 Thread Mark Rees
Hello I am having trouble with is_dir I am trying to check whether /lists/admin/temp exists (which it does). However, I cannot get the function to work by specifying the path as above - it only works if I do it relative to the current working directory. So: -- www.itsagoodprice.com - top-brand

Re: [PHP] is_dir paths

2005-09-26 Thread Ondrej Ivanič
Jochem Maas wrote: what does the following output: var_dump (getcwd()); I have better question: what does the following output: var_dump (realpath(getcwd())); var_dump (realpath('temp')); var_dump (realpath("/lists/admin/temp")); -- Ondrej Ivanic ([EMAIL PROTECTED]) -- PHP General Mailing

Re: [PHP] is_dir() question

2005-09-26 Thread Jochem Maas
maybe the following helps you (a little): vlad georgescu wrote: i have the code below ** *if ($dir = @opendir("dir2open")) $path = "dir2open"; // make this into a proper path! if ($dir = @opendir($path)) { while($file = readdir($dir)) { //if (($file!='.') && ($file!='..') && ($file!='.htacce

Re: [PHP] is_dir paths

2005-09-26 Thread Jochem Maas
Mark Rees wrote: Hello I am having trouble with is_dir I am trying to check whether /lists/admin/temp exists (which it does). However, I cannot get the function to work by specifying the path as above - it only works if I do it relative to the current working directory. So: var_dump (is_dir(g

[PHP] is_dir paths

2005-09-26 Thread Mark Rees
Hello I am having trouble with is_dir I am trying to check whether /lists/admin/temp exists (which it does). However, I cannot get the function to work by specifying the path as above - it only works if I do it relative to the current working directory. So: var_dump (is_dir(getcwd())); var_dump

[PHP] is_dir() question

2005-09-26 Thread vlad georgescu
i have the code below ** *if ($dir = @opendir("dir2open")) { while($file = readdir($dir)) { //if (($file!='.') && ($file!='..') && ($file!='.htaccess') && ($file!=' index.php')) { // if (is_dir($file)) { // print just "." & ".." // if (is_file($file)) { // works fin

Re: [PHP] is_dir & is_file bugs?

2005-02-08 Thread Afan Pasalic
Yup! That's the one! I was missing PATH... :) Thank you very much for such a nice explanation! -afan M. Sokolewicz wrote: Matt M. wrote: $path = 'product_images'; $handle = opendir($path); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") {

Re: [PHP] is_dir & is_file bugs?

2005-02-08 Thread Afan Pasalic
Nope! It doesnt work either... :( Matt M. wrote: $path = 'product_images'; $handle = opendir($path); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo $file; if (is_dir($file)) { echo ' <-- folde

Re: [PHP] is_dir & is_file bugs?

2005-02-08 Thread M. Sokolewicz
Matt M. wrote: $path = 'product_images'; $handle = opendir($path); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo $file; if (is_dir($file)) { echo ' <-- folder'; $folders[] = $fi

Re: [PHP] is_dir & is_file bugs?

2005-02-08 Thread Matt M.
> $path = 'product_images'; > $handle = opendir($path); > while (false !== ($file = readdir($handle))) > { > if ($file != "." && $file != "..") > { > echo $file; > if (is_dir($file)) > { > echo ' <-- folder'; >

[PHP] is_dir & is_file bugs?

2005-02-08 Thread Afan Pasalic
I have script that create directories after item's name and each directory has 2 images: big image and it's thumbnail (both jpgs) But, when I run this code: $path = 'product_images'; $handle = opendir($path); while (false !== ($file = readdir($handle))) { if ($file != "." && $

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Chris
John Nichel wrote: Chris wrote: if (is_dir($file) || ($file!=".") || ($file!="..")) continue; That will match everything and anything, files and dot directories... The first statement by the OP should work fine. All three will eval to true if it is a directory, and the directory isn't . or ..

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Curt Zirzow
* Thus wrote Mark: > I'm having a problem I haven't encountered before. I'm using PHP > 4.3.4 (upgrading the 4.3.9, but humor me) on Windows. > > I'm using the following code snippet to try to get all the > subdirectories of a directory into an array. > > $maildir=MERCURY."/MAIL"; > $handle=o

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Mark
--- Jason Wong <[EMAIL PROTECTED]> wrote: > On Tuesday 28 September 2004 03:54, Mark wrote: > > > With the echos above in place, I get the resource handle, and it > > echos everything you would expect except that is_dir() fails to > > recognize the directories. > > Because is_dir() expects a pa

Re: [PHP] is_dir on WIndows

2004-09-27 Thread John Nichel
Mark wrote: --- John Nichel <[EMAIL PROTECTED]> wrote: Chris wrote: if (is_dir($file) && ($file!=".") && ($file!="..")) { $users[]=$file; } It's only adding it to the array if all 3 of those are true. and since $file can't be both '.' and '..' at the same time, it's never matching. I'd d

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Mark
--- Jason Wong <[EMAIL PROTECTED]> wrote: > On Tuesday 28 September 2004 03:54, Mark wrote: > > > With the echos above in place, I get the resource handle, and it > > echos everything you would expect except that is_dir() fails to > > recognize the directories. > > Because is_dir() expects a pa

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Mark
--- John Nichel <[EMAIL PROTECTED]> wrote: > Chris wrote: > >if (is_dir($file) && ($file!=".") && ($file!="..")) { > > $users[]=$file; > >} > > > > It's only adding it to the array if all 3 of those are true. and > since > > $file can't be both '.' and '..' at the same time, it's n

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Jason Wong
On Tuesday 28 September 2004 03:54, Mark wrote: > With the echos above in place, I get the resource handle, and it > echos everything you would expect except that is_dir() fails to > recognize the directories. Because is_dir() expects a path to the file as well, otherwise it would be trying to l

Re: [PHP] is_dir on WIndows

2004-09-27 Thread John Nichel
Chris wrote: if (is_dir($file) && ($file!=".") && ($file!="..")) { $users[]=$file; } It's only adding it to the array if all 3 of those are true. and since $file can't be both '.' and '..' at the same time, it's never matching. I'd do something like: if (is_dir($file) || ($file!=".") |

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Chris
if (is_dir($file) && ($file!=".") && ($file!="..")) { $users[]=$file; } It's only adding it to the array if all 3 of those are true. and since $file can't be both '.' and '..' at the same time, it's never matching. I'd do something like: if (is_dir($file) || ($file!=".") || ($file!=".."

[PHP] is_dir on WIndows

2004-09-27 Thread Mark
I'm having a problem I haven't encountered before. I'm using PHP 4.3.4 (upgrading the 4.3.9, but humor me) on Windows. I'm using the following code snippet to try to get all the subdirectories of a directory into an array. $maildir=MERCURY."/MAIL"; $handle=opendir($maildir); // echo $handle;

Re: [PHP] is_dir and cache problem ...

2001-12-23 Thread Daniel Urstöger
thx for your help ! Since I am the only one who works on the whole server, it´s all my stuff :) Yeah, but the increasing of the random_ID is surely a good way .. Will check on that ! thx again ! :)) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

Re: [PHP] is_dir and cache problem ...

2001-12-23 Thread Bogdan Stancescu
Forgot a couple of double quotes and the mode for mkdir. Perfectionist, you see... :-) Bogdan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PRO

Re: [PHP] is_dir and cache problem ...

2001-12-23 Thread Bogdan Stancescu
I do the same with is_file() in several scripts and it works just fine without clearing the cache. Don't know about dirs but I can't see why it may be different - should use the exact same functions internally. On a side note, I'd rather recommend using a loop like This way you have better cont

[PHP] is_dir and cache problem ...

2001-12-23 Thread Daniel Urstöger
Hiya ! I am working on a download script right now, and I have a question about a part of my code: do { $random_ID = rand(10,99); $download_dir = "$today $random_ID"; if (!@is_dir($download_dir)) mkdir("$download_dir",0777); }while(@!is_dir($download_dir)); So, I do this loo

[PHP] is_dir() function on Win32 platform

2001-02-01 Thread Michael Hall
I'm developing on Windows, and I have a bit of code that is designed to do a quick recursive read on a folder. An integral part of this is the use of the is_dir() function to decide if it should recurse or not. DoIt('G:\\'); function DoIt($path){ $handle=opendir("$path"); echo "

[PHP] is_dir

2001-01-15 Thread Pat Hanna
I have a snipet of code i'm using for a file maintanance program. I have no idea why but when the main loop repeats, the is_dir function doesn't return true even though it prints out a directory in the server. chdir("/certain/place/for/files/"); $handle=opendir("."); $file=readdir($handle); //to