Conversation
Notices
-
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-
@mushi The way files work on linux, you're actually moving the file from one name to another.
-
@ceruleanspark of course
-
@mushi Why would DOS use separate commands to move a file and to rename it?
-
@mushi Because of what really happens when you rename a file.
-
@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. -
@takepapayaakenji i do not know the first thing abut DOS, but i'm having to study linux for a selection exam
-
@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). -
@takepapayaakenji This is the sane way to do it.
The DOS way is rarely the sane way to do anything. -
@maiyannah BSD is often the sane way to do things.
-