|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-06-29 22:45 UTC] jim at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jul 05 04:00:01 2026 UTC |
I use the following code to test for the existance of a directory if($rc = opendir($directory)) { /* Perform code for directory exists */ else { /* Create directory and do create processing */ } This code works fine on Linux but always gives a good return even if the directory does not exist on Windows. Looking in readir.c i see the following code if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0) { if (errno == ENOENT) dp->finished = 1; <-- I'm not sure what this is supposed to do else return NULL; } It seems that the function is to behave differently if the file does not exist, than if there is an error in the file spec. If I comment out the check for enoent, and return null if the file does not exist, and recompile, my code works identically on Windows and Linux. If I was sure of why the code was originally set up like it is, I'd have a go at fixing it, even with my very rusty C, but I guess I need to mess around a little more with the source, and watch how you guys do it, before I push the boat out. Best regards. . . Fred