php rename used to merge folders

Discussion in 'PHP' started by Silver89, Jul 5, 2009.

  1. #1
    Hi,

    If I have the following directory structure:

    project/Part 1
    project/Part 2
    project/Part 3

    and have the following example files

    project/Part 1/1.avi
    project/Part 2/2.avi
    project/Part 3/3.avi

    and then perform this php rename query:

    
    <?php
    rename("project/Part 2", "project/Part 1");
    rename("project/Part 3", "project/Part 1");
    ?> 
    
    PHP:
    Then will it just merge the two folders? Also if any of the files exist with the same name will they just be overwritten?

    Thanks
     
    Silver89, Jul 5, 2009 IP
  2. Wrighty

    Wrighty Peon

    Messages:
    199
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why don't you try it? :)
     
    Wrighty, Jul 5, 2009 IP
  3. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #3
    I've done it now, had 580GB of uploaded files so didn't want to risk it.
     
    Silver89, Jul 5, 2009 IP