copy/move files..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jodleren

    #1

    copy/move files..

    While reading php.net I found

    " bool copy ( string $source , string $dest [, resource $context ] )
    Makes a copy of the file source to dest .
    If you wish to move a file, use the rename() function. "

    ..... what? rename can move a file...?
  • Rik Wasmus

    #2
    Re: copy/move files..

    On Mon, 07 Jan 2008 17:22:02 +0100, jodleren <sonnich@hot.ee wrote:
    While reading php.net I found
    >
    " bool copy ( string $source , string $dest [, resource $context ] )
    Makes a copy of the file source to dest .
    If you wish to move a file, use the rename() function. "
    >
    .... what? rename can move a file...?
    Yes, with some caveats, quite common practice.
    --
    Rik Wasmus

    Comment

    • Jonas Werres

      #3
      Re: copy/move files..

      .... what? rename can move a file...?

      Never used DOS?

      Comment

      • giblfiz

        #4
        Re: copy/move files..

        On Jan 7, 11:22 am, jodleren <sonn...@hot.ee wrote:
        While reading php.net I found
        >
        " bool copy ( string $source , string $dest [, resource $context ] )
        Makes a copy of the file source to dest .
        If you wish to move a file, use the rename() function. "
        >
        .... what? rename can move a file...?
        Think of the entire folder path to the file as its name,
        so if you have a file in folder /foo/bar/ named "Myfile" really how
        the OS thinks of it is as a file named "/foo/bar/Myfile". if you
        rename it to "/foo/BAZ/Myfile" it is now in the directory BAZ. its
        "Name" for the OS has changed, even though its name for you, "Myfile"
        hasn't. This is a gross oversimplificat ion, but I think it should help
        anyway.

        Comment

        • =?ISO-8859-15?Q?Iv=E1n_S=E1nchez_Ortega?=

          #5
          Re: copy/move files..

          jodleren wrote:
          .... what? rename can move a file...?
          Yeah. Welcome to the wonderful world of filesystem jargon.

          --
          ----------------------------------
          Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

          Un ordenador no es un televisor ni un microondas, es una herramienta
          compleja.

          Comment

          Working...