I want to get the date when a folder was renamed, from terminal it can be done using the stat
command, e.g.:
> stat -x folders/folder1
File: "folders/folder1"
Size: 64 FileType: Directory
Mode: (0755/drwxr-xr-x) Uid: (2006390509/username) Gid:
(296108113/EMEA\Domain Users)
Device: 1,4 Inode: 2599274 Links: 2
Access: Mon Nov 12 17:59:57 2018
Modify: Mon Nov 12 14:12:20 2018
Change: Mon Nov 12 17:28:01 2018
The change date is the last date the folder's metadata was changed, which includes renaming.
Is there any way to get it with Go without using os.exec
and parsing the output? os.Stat
seems to provide only the last modification date which doesn't change when the folder is renamed.