Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Apr 2021 02:44:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 254842] cp -p does not support preserving created time (btime)
Message-ID:  <bug-254842-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254842

            Bug ID: 254842
           Summary: cp -p does not support preserving created time (btime)
           Product: Base System
           Version: 13.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: akw24542@eoopy.com

1) Create a .txt file. Then open the .txt file and edit the .txt file and save.
Now have 3 different timestamps for atime, mtime and btime.


stat -f "Accessed (atime): %Fa%nModified (mtime): %Fm%nCreated  (btime): %FB"
'/home/liveuser/Desktop/123.txt' 
Accessed (atime): 1617769412.044026000
Modified (mtime): 1617769415.349392000
Created  (btime): 1617768991.589695000


2) Copy the file from the source to the destination.

cp -p '/home/liveuser/Desktop/123.txt' '/'


3) View the file info of the destination.

stat -f "Accessed (atime): %Fa%nModified (mtime): %Fm%nCreated  (btime): %FB"
'/123.txt'                       
Accessed (atime): 1617769412.044026000
Modified (mtime): 1617769415.349392000
Created  (btime): 1617769415.349392000


Result:
atime and mtime were preserved. But btime was not preserved by the source and
was automatically set to mtime.


Expectation:
cp -p supports preserving btime from the source to the destination. The support
works for files and directories.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-254842-227>