Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File management problem...

    A very curious thing has recently happened to me. I uploaded several files, then attempted to delete them, only to find that they coudn't be; the cause: the files you selected don't exist. This was extremely odd to me; so, I tried my hand at getting rid of them via PHP isntead of my file manager. Unlink() didn't work, nor did uploading a file with the exact same name; it simply showed up along with the buggy one, with the exact same name. So, I tried to move them into a directory and delete the directory with rmdir() to no avail.

    Now I ask, is there a workaround, any way for me to rid my file manager of these buggy files?

  • #2
    New Coder
    Join Date
    Aug 2007
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this is weird have you tryed veiwing one to see if there is any information or data in it ?

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Indeed. The file manager shows each as having a filesize, but upon editing, it reports that it could not retrieve the data...

  • #4
    New Coder
    Join Date
    Jun 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, well, I've found the problem, but I have a bad feeling it doesn't have a solution...

    I had several filenames stored in a file. Then, I ran a PHP script that saved the corresponding files with the names stored in said file. Unfortunately, I used PHP's file() function to pull the names, and forgot to use the FILE_IGNORE_NEW_LINES flag. This, I take it, is a serious problem.

    It means that there are files in my manager with carriage returns at the end of their names that is causing them to be indestructible. Solutions?
    Last edited by TPTZ; 08-12-2007 at 04:59 PM.

  • #5
    New Coder
    Join Date
    Aug 2007
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if your file manager is on a server can you ask the server administrator to take out the seleted files ? or if that cant be done back up the files you want to keep and have it all cleared then upload your files again

  • #6
    New Coder
    Join Date
    Jun 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Gah! No other way around, then? Okay, thanks.

    SOLUTION!
    Just had to call unlink() on the filename with a "\r" appended...
    Last edited by TPTZ; 08-12-2007 at 05:05 PM.

  • #7
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    Assuming you're on linux you could use a wildcard for the filename when deleting the files from the command line. ie.
    Code:
    rm file*
    This is for future reference, I know you solved your problem.


  •  

    Posting Permissions

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