Why does the file creation date remain the same when copying and pasting a file

filesystem

When copying a file from flash drive to macOS file system, the file creation date remains the same as the original file.

If it is on Windows, the file creation date of a new file when copying a file and pasting it will not be same as the original file, but will have the current date time instead.

Why is the behavior different between OS? Is this due to the different specification in NTFS and HFS file system?

Best Answer

This is because the GUI copy function on macOS preserves all attributes by default.

To put it in command line terms:

When you copy and paste a file in macOS, by default its doing this:

cp -a /source/file1 /destination/

which preserves attributes such as permissions and timestamps.

The only workaround for this (i.e., to achieve Windows-like behavior) is to copy files using the command line. Applications -> Terminal.app

and use the following command:

cp -r /source/file1 /destination

Alternatively, you can simplify the process by allowing terminal to get file paths by simply dragging and dropping the source file and the destination folder:

  1. Search
  2. Type "Terminal". Press return
  3. Type cp -r
  4. Drag and drop the source file
  5. Drag and drop the destination file
  6. Press return again.