#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 1999
    Posts
    13
    Rep Power
    0
    We are trying to remove multiple files (with different extentions) and having some PHP syntas troubles:

    unlink("..$dir/some_string.*");

    does NOT seem to work!

    In other words, we are trying to 'imitate UNIX

    rm some_string.*

    Thanks in advance.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Toronto, Canada
    Posts
    13
    Rep Power
    0
    try this: i havn't checked, might work:

    while($file=$d->read()) {
    if (ereg("somestring",$file)) unlink($file);
    }

    disclaimer as usual
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Toronto, Canada
    Posts
    13
    Rep Power
    0
    sorry forgot this. add this line before the rest of the code..

    $d = dir(".");

    or

    $d = dir("somedirstring");

    hope this helps..

Similar Threads

  1. Can't move or delete it!
    By Hykinsel007 in forum Windows Help
    Replies: 3
    Last Post: June 15th, 2004, 03:41 PM
  2. How do I extract data form multiple files?
    By cols2910 in forum Visual Basic Programming
    Replies: 1
    Last Post: January 21st, 2004, 06:44 AM
  3. Replies: 6
    Last Post: December 21st, 2003, 04:24 PM
  4. Replies: 1
    Last Post: December 20th, 2003, 12:22 PM

IMN logo majestic logo threadwatch logo seochat tools logo