Is renaming an ‘alias’ for moving?

Is it true to say (on Windows and UnixLinuxOS X) that renaming a file or directory is just an alias for moving?

e.g.

  1. Are there any side effects to either which are not present on the other?
  2. Does ‘rename’ actually ‘move’ move under the hood?

Is there a way I can provedisprove this?

6

Is there a way I can provedisprove this?

No, because

  • Different operating systems do things differently.
  • Different kinds of renames/moves can be conceptually different acts:

    • Renaming/moving a file within the same directory,
    • Renaming/moving a file from one folder/directory to another on the same logical device,
    • Renaming/moving a file from one logical device to another, and
    • Renaming/moving a file from one physical device to another.

On most common modern systems, renaming/moving a file within the same logical device is a simple matter of deleting the reference to the file object from the original location and adding a reference to the file object in the target location. The contents of the file are not touched.

This is impossible when “moving” across physical devices. The contents of the file to be moved don’t exist on the target device. The contents have to be copied. How moving across logical devices depends on the operating system’s concept of a logical device.

The extra options supported by Win32 MoveFileEx function provide a good overview and explanation of the similarities and differences between renaming and moving.

When moving files across volumes, a copy (followed by delete) is performed.

From the perspective of an ordinary computer user, when one wants to perform a rename, one would expect the computer to prevent this from overwriting an existing file of the same name.

Whereas copying and moving would offer a choice of cancelling, auto-renaming, or replacing (overwriting).

Note that this is from a user’s perspective, not from a programmer’s perspective. However, the API must support additional flags so that the programmer can implement the user’s expectations.

In summary, due to conventions inherited from the days of MS-DOS, a “rename” is perceived to be less destructive (other than being renamed) than a “move”, even though the distinction no longer has any relevance to the underlying mechanism (the file system) unless the operation spans different file systems.

Unix and Linux had been designed by programmers, for programmers. Therefore the opinions of ordinary computer users had never factored into the design of file system commands, so the distinction does not exist there.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật