4

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?

2 Answers 2

5

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.
5
  • @user3439894 Look again.
    – Shayan
    Commented Jan 16, 2018 at 6:24
  • There is a -R, but no -r. Did you install GNU coreutils? What does cp --version report?
    – muru
    Commented Jan 16, 2018 at 8:57
  • @Shayan OSX cp gives$ cp usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory no -r
    – mmmmmm
    Commented Jan 16, 2018 at 10:37
  • 1
    Under COMPATIBILITY there's: Historic versions of the cp utility had a -r option. This implementation supports that option; however, its use is strongly discouraged, as it does not correctly copy special files, symbolic links, or fifo's. Commented Jan 16, 2018 at 10:40
  • It would be great if this answer described what the -a and -r (or -R) options actually do. Basically, omitting -a stops preserving the file attributes, and adding -R (recursive) makes it work with folders.
    – Kal
    Commented Feb 1, 2021 at 1:23
5

I just found the answer in this Mac Help post by Gregory Pratt:

The Windows philosophy toward creation times is filesystem-centric; the timestamp reflects the time when the file entry was created on that volume. For this reason, when you copy the file to a different volume, the copy gets a new creation timestamp -- one that might even be newer than the file modification time.

The Mac philosophy toward creation times is document-oriented; the timestamp indicates when the document (the contents of the file) was first saved.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .