8 ms·
Linus on btime: “Let’s wait five years” (2010)
- wener 10y agoMaybe it's time ? btime I mean Under Linux $ stat `which stat` File: '/usr/bin/stat' Size: 80944 Blocks: 160 IO Block: 4096 regular file Device: fd01h/64769d Inode: 1196257 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2016-09-22 15:30:03.759501920 +0800 Modify: 2016-02-18 21:37:47.000000000 +0800 Change: 2016-09-08 18:17:26.611169858 +0800 Birth: - Under OSX $ stat `which stat` File: '/usr/local/opt/coreutils/libexec/gnubin/stat' -> '../../bin/gstat' Size: 15 Blocks: 8 IO Block: 4096 symbolic link Device: 1000004h/16777220d Inode: 17293277 Links: 1 Access: (0755/lrwxr-xr-x) Uid: ( 501/ wener) Gid: ( 80/ admin) Access: 2016-01-26 19:01:40.000000000 +0800 Modify: 2016-01-21 02:56:37.000000000 +0800 Change: 2016-01-26 19:01:40.000000000 +0800 Birth: 2016-01-21 02:56:37.000000000 +0800
- pawadu 10y agoSo what is the difference between "modify" and "change"??
- XorNot 10y agoContent modification vs. metadata modification I believe.
- yAnonymous 10y agoIt's the other way around. ctime (status change) for metadata, mtime (modification) for files contents, atime (access) for file access.
- merraksh 10y agoPart of the confusion for {c,m}time probably comes from [c]time: [c]hange [m]etadata [m]time: [m]odify] file [c]ontents
- pawadu 10y agoyeah, that was my first reaction: how do I know which one is which?
- inopinatus 10y agowell, if you need to check in future, like this: $ man 2 stat
- Xophmeister 10y agoctime is when the inode or file changes in terms of stat, ownership, etc. mtime is when the contents of the file is changed.
- guessmyname 10y agoOff Topic — Which one is better? $ stat `which stat` $ stat $(which stat)
- striking 10y agoBackticks if lazy, parenthetical for complicated command lines.
- hmpc 10y agoBackticks are discouraged for any new scripts, since they complicate nesting, quoting, and escaping, besides being graphically less explicit. See also http://mywiki.wooledge.org/BashFAQ/082 http://mywiki.wooledge.org/BashFAQ/082. The Open Group also discourages backticks: http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03 http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_....
- __michaelg 10y ago$ stat "$(which stat)" shellcheck or its online version http://www.shellcheck.net/ http://www.shellcheck.net/ help a lot
- aelleth 10y ago$(...) doesn't trip Shellcheck and is slightly more readable and less error-prone in complex statements, e.g. if you have to nest commands.
- rascul 10y agowhich probably isn't the best tool to use here. http://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then http://unix.stackexchange.com/questions/85249/why-not-use-wh...
- pimlottc 10y agoI was about to ask how you got that pretty-print output from OSX's `stat` before I noticed you were using `gstat`. Oddly enough, the native `stat -x` gives a similar output but omits birth time: $ stat -x `which stat` File: "/usr/bin/stat" Size: 27376 FileType: Regular File Mode: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ wheel) Device: 1,4 Inode: 192606219 Links: 1 Access: Thu Sep 22 11:50:55 2016 Modify: Fri Jul 8 23:03:34 2016 Change: Sun Jul 31 21:44:22 2016
- pawadu 10y ago> Let's wait five years and see if there is actually any consensus on it being needed and used at all, rather than rush into something just because "we can". This is why every project maintainer dreams of being Linus...
- buserror 10y agoWell it IS pretty useful; that's why most of my documents start with a date part like "160822 Something Something"; they'll still be sorted by /creation time/ next time I make a change. Also very useful for photographs for example, when you can edit the EXIF without the whole lot becoming randomly sorted.
- kalleboo 10y agoYeah, I use creation time all the time on OS X. Meanwhile I can't imagine what access time would be used for.
- Xophmeister 10y agoWe use atime at work as a proxy for "does this file really need to exist?" on our cluster's scratch disks.
- 0x0 10y agoatime is heavily used by traditional mail clients like mutt, to determine which mailboxes have new mail: If atime < mtime, then there has been a write to a file since the last read. Because updating atime on every file access carries an IO overhead, there's a mount option "relatime" that only updates atime if atime < mtime. This preserves the "new mail" feature of mutt, but doesn't require atime writes for every file read operation, which is a decent compromise.
- c3833174 10y agorelatime has also been the default on Linux for many years.
- unwind 10y agoMods: the title could do with some editing, like making it "wait for", and a space before the year. Thanks.
- OJFord 10y agoI agree, it's completely confusing, and even grammatical not. > For `btime`, Linus told us to "wait five years" Would be my suggestion. Or perhaps: > Linus told us "wait five years" for `btime`
- PercussusVII 10y agoChrist its almost impossible to read that page
- vog 10y agoCare to elaborate? I didn't have any issues reading that page. Moreover, I don't have any clue what could make it hard to read for others.
- CyberShadow 10y agoThe link has been changed by a moderator. I don't know what the original link was, though.
- salamisultan 10y agoChrist, lets worship the Salami Sultan over his spit. What an honorable loogey!
- caf 10y agoAnother archive of the same mail is http://lkml.iu.edu/hypermail/linux/kernel/1007.2/02325.html http://lkml.iu.edu/hypermail/linux/kernel/1007.2/02325.html
- CyberShadow 10y agoExt4, BTRFS, ZFS, NTFS, HFS+, UFS2 all track creation time. Kernel support is past due.