Re: PHP 4.0 Bug #7344: opendir always returns a resource even on non-existen directories
| From: | jalal | Date: | Fri, 20 Oct 2000 10:29:28 +0000 |
| Subject: | Re: PHP 4.0 Bug #7344: opendir always returns a resource even on non-existen directories | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35639@lists.php.net to get a copy of this message | ||
Here's a patch to make opendir function the same on Windows as on
Linux. Could someone insert it please?
(I assume it should function the same under Windows? It make se
to
me...)
-------------------------------------------8X---------------------------
-----
--- php4/win32/readdir.c Fri Oct 20 12:17:10 2000
+++ php4/win32/readdir.bak Fri Oct 20 12:17:34 2000
@@ -38,10 +38,7 @@
dp->dir = strdup(dir);
if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0) {
- if (errno == ENOENT)
- dp->finished = 1;
- else
- return NULL;
+ return NULL;
}
dp->handle = handle;
free(filespec);
-------------------------------------------8X---------------------------
-----
--jalal --