473,811 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is_dir problem

i run 4.3.4

but is_dir doesn't work always.

when i put a counter in a readdir loop, it returns the number 5

that is;

..
...
test1
test2
test3

those are testdirectorys, but when i do a is_dir on the test directory it
doesn't return true!

is this just a bug in 4.3.4 ?

do i need to compile a new version or is there another directory check
function?

bart
Jul 17 '05 #1
5 4950
bart wrote:
... when i do a is_dir on the test directory it
doesn't return true!

is this just a bug in 4.3.4 ?


I'm also using PHP 4.3.4 and is_dir() works fine here.
Maybe the bug is in your code?
--
USENET would be a better place if everybody read: ** mail address **
http://www.catb.org/~esr/faqs/smart-questions.html ** is valid for **
http://www.netmeister.org/news/learn2quote2.html ** "text/plain" **
http://www.expita.com/nomime.html ** to 10K bytes **
Jul 17 '05 #2
On Sun, 14 Mar 2004 23:50:14 +0100, "bart" <ba**@thatissec ret.nlm> wrote:
i run 4.3.4

but is_dir doesn't work always.

when i put a counter in a readdir loop, it returns the number 5

that is;

.
..
test1
test2
test3

those are testdirectorys, but when i do a is_dir on the test directory it
doesn't return true!

is this just a bug in 4.3.4 ?


Can't say based on the lack of information you've posted. It's far, far more
likely that there's a bug in your code, rather than a simple function like
is_dir(), used by thousands of people, returns the wrong results. Maybe there
is a bug in is_dir(), it's not impossible, but I'd bet the problem lies
elsewhere.

Show your code.
Show a short runnable testcase.
Show some proof that the names above actually are directories.
etc.

--
Andy Hassall <an**@andyh.co. uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>
Jul 17 '05 #3
*sigh* Another newbie blaming PHP for his own bug... You probably didn't
append the parent path to the parameter to is_dir(). readdir() doesn't
return the full path, just the name of the folder. Use glob() instead, it's
easier to use.

Uzytkownik "bart" <ba**@thatissec ret.nlm> napisal w wiadomosci
news:40******** *************@n ews.xs4all.nl.. .
i run 4.3.4

but is_dir doesn't work always.

when i put a counter in a readdir loop, it returns the number 5

that is;

.
..
test1
test2
test3

those are testdirectorys, but when i do a is_dir on the test directory it
doesn't return true!

is this just a bug in 4.3.4 ?

do i need to compile a new version or is there another directory check
function?

bart

Jul 17 '05 #4
you are right,

thank you for helping me, that was indeed the problem.
next time i should go to bed when it gets late and i start to get tired...
(or drink more coffee)

bye now

"Chung Leong" <ch***********@ hotmail.com> wrote in message
news:Zb******** ************@co mcast.com...
*sigh* Another newbie blaming PHP for his own bug... You probably didn't
append the parent path to the parameter to is_dir(). readdir() doesn't
return the full path, just the name of the folder. Use glob() instead, it's easier to use.

Jul 17 '05 #5
you are all right, it was my fault !

thanks for replying ...

grtx,
Bart

"Andy Hassall" <an**@andyh.co. uk> wrote in message
news:88******** *************** *********@4ax.c om...
On Sun, 14 Mar 2004 23:50:14 +0100, "bart" <ba**@thatissec ret.nlm> wrote:
Can't say based on the lack of information you've posted. It's far, far more likely that there's a bug in your code, rather than a simple function like
is_dir(), used by thousands of people, returns the wrong results. Maybe there is a bug in is_dir(), it's not impossible, but I'd bet the problem lies
elsewhere.

Show your code.
Show a short runnable testcase.
Show some proof that the names above actually are directories.
etc.

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3818
by: lawrence | last post by:
In the function below, before I open the directory I first test to make sure the address I have is, in fact, a directory. This function was working fine on one web server running FreeBSD and PHP 4.06. However, today I'm trying to run this software on a new server (RH Linux 9, PHP 4.2.3) and the directory is failing the is_dir() test. The error message that I have in my code is printing out this error: In getListOfAnyDirectory(), we...
5
2721
by: ravenslay3r | last post by:
I'm using a script to grab images from a directory and put them to the screen, but i want it to ignore sub-directories like CVS/ . Adding the tag "&& !is_dir($file)" to the correct conditional statement solved it on my test server, but not on the actual site. How is this possible? How can I fix it? thanks,
117
7278
by: Peter Olcott | last post by:
www.halting-problem.com
28
5228
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I don't know at runtime what the child class is? I'm using Activator.CreateInstance() to load the...
6
3818
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
16
4932
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by Microsoft must be installed on their servers. Now german Umlaute (ä, ü, ö) and quotes are returned incorrectly in SOAP fault responses. This can be easily verified: Implement the following in a web service method (just raises a SOAPException with a...
2
2586
by: Juby | last post by:
I'm creating a script for our website which will function as something of a docment manager. The backend features an option to create a new directory in the uploads subdirectory. The problem is, once I've used mkdir() to create this file, when I later run is_dir() on the filename, I get 'false'. Even worse, if I run is_file() on the new directories, I get false as well. The same thing seems to be happening to files I submit via the...
12
2338
by: comp.lang.php | last post by:
Env: Windows XP, Apache 1.33, PHP 5.2.0 <? echo is_dir($_SERVER) . " for dir = " . $_SERVER); ?>
1
2412
by: ndlarsen | last post by:
Hello. I have a minor issue with is_dir(). When running two almost identical scripts from two different directories with same target directory I get different output. The only difference between the scripts is a variable containing the path to the target directory. The scripts are located here: http://ionline.dk/test/test1.php
0
9730
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10403
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.