SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    England
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    spot the invalid argument

    Hi,

    Can anyone see why PHP is throwing this error considering the directory is present. I don't have a clue where the invalid argument lies.

    Warning: opendir(../../fyp_presentations/A046004/images): failed to open dir: Invalid argument in C:\apache2\co_teach\odl\project-showcase\upld_archcheck.php on line 28

    Cheers

    Dean
    P.S. I have also tried adding a slash after /images. Still no joy

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Post the code line.

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    England
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, here is the line of code, would have thought this is fairly standard though

    if (($handle = opendir($dir)) == FALSE)

  4. #4

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What does $dir contain? Can you do a var_dump($dir)?

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    England
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok this is the result of the var dump. Permissions on the directory should not affect the opendir() function should they as long as the dir isn't hidden or archived? P.S. This is a Win XP system

    string(38) "../../fyp_presentations/A046004/images"

    Thanks for the quick responses by the way.

  6. #6

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it C:\apache2\co_teach\fyp_presentations\A046004\images you want to access or some other directory? I found several bug reports about such an error message, but they were about mapped network drives.

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    England
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, thats the directory I want to access. The thing is there are other directories at the same level as this one and the function works for them. I think I'll try some different dir/file combinations to see what the effect is.

  8. #8
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    England
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, after much hacking around I gave up and downloaded a different recursive delete script. This one seems to work, I got it from

    http://codewalkers.com/seecode/436.html

    Its nice and simple as well.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •