Conversation

Notices

  1. why would linux use the same comand to move a file and to rename it?

    Thursday, 10-Nov-16 23:17:44 UTC from web
    1. @mushi The way files work on linux, you're actually moving the file from one name to another.

      Thursday, 10-Nov-16 23:20:09 UTC from web
      1. @ceruleanspark of course

        Thursday, 10-Nov-16 23:20:46 UTC from web
    2. @mushi Why would DOS use separate commands to move a file and to rename it?

      Thursday, 10-Nov-16 23:25:04 UTC from gs.kawa-kun.com
      1. @takeFrankerZakenji Renaming the file does not change the file's location in the file allocation table.  Move does.  Move will result in data being relocated on the disk even if it doesn't change position in the directory structure.  Rename only changes the label on the file record.

        In case you wanted the real answer.

        Thursday, 10-Nov-16 23:40:30 UTC from community.highlandarrow.com
        1. @maiyannah Looks like the BSD mv command will use rename(2) in certain cases, which doesn't change the file's location as far as I can tell (both the source and target must be on the same filesystem): http://u.daggsy.com/px

          GNU mv doesn't use rename(2).

          Thursday, 10-Nov-16 23:47:11 UTC from gs.kawa-kun.com
          1. @takepapayaakenji This is the sane way to do it.

            The DOS way is rarely the sane way to do anything.

            Friday, 11-Nov-16 00:11:01 UTC from community.highlandarrow.com
            1. @maiyannah BSD is often the sane way to do things.

              Friday, 11-Nov-16 00:23:44 UTC from gs.kawa-kun.com
      2. @takepapayaakenji i do not know the first thing abut DOS, but i'm having to study linux for a selection exam

        Thursday, 10-Nov-16 23:41:31 UTC from web
    3. @mushi Because of what really happens when you rename a file.

      Thursday, 10-Nov-16 23:39:58 UTC from gs.smuglo.li