Title: On filesystems which do not support birthtime, stats.birthtime can be greater than stats.mtime · Issue #2222 · nodejs/node · GitHub
Open Graph Title: On filesystems which do not support birthtime, stats.birthtime can be greater than stats.mtime · Issue #2222 · nodejs/node
X Title: On filesystems which do not support birthtime, stats.birthtime can be greater than stats.mtime · Issue #2222 · nodejs/node
Description: stats.birthtime tracks ctime on filesystems which do not support birthtime, even if stats.ctime > stats.mtime or stats.ctime > stats.atime. It would be better in this case if stats.birthtime be set to the earliest of all available timest...
Open Graph Description: stats.birthtime tracks ctime on filesystems which do not support birthtime, even if stats.ctime > stats.mtime or stats.ctime > stats.atime. It would be better in this case if stats.birthtime be set...
X Description: stats.birthtime tracks ctime on filesystems which do not support birthtime, even if stats.ctime > stats.mtime or stats.ctime > stats.atime. It would be better in this case if stats.birthtime ...
Opengraph URL: https://github.com/nodejs/node/issues/2222
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On filesystems which do not support birthtime, stats.birthtime can be greater than stats.mtime","articleBody":"stats.birthtime tracks ctime on filesystems which do not support birthtime, even if stats.ctime \u003e stats.mtime or stats.ctime \u003e stats.atime.\n\nIt would be better in this case if stats.birthtime be set to the earliest of all available timestamps.\n\nHere is a test to reproduce, which should pass on OS X and fail on Ubuntu:\n\n``` js\nvar fs = require('fs');\nconsole.log('creating...');\ntry {\n fs.unlinkSync('testbirthtime');\n} catch (error) {}\nfs.writeFileSync('testbirthtime', '');\nconsole.log('statting...');\nvar before = fs.statSync('testbirthtime');\nif (before.mtime.getTime() === before.ctime.getTime() \u0026\u0026 before.ctime.getTime() === before.birthtime.getTime()) {\n console.log('stats.mtime===stats.ctime===stats.birthtime');\n} else {\n console.log(JSON.stringify(before));\n // should never be here, unless the test is faulty.\n throw new Error('expected stats.mtime===stats.ctime===stats.birthtime after create');\n}\n// give enough time for filesystem timestamp granularity\nconsole.log('waiting 3 seconds...');\nsetTimeout(\n function() {\n console.log('changing mode to bump ctime...');\n fs.chmodSync('testbirthtime', '777');\n console.log('statting again...');\n var after = fs.statSync('testbirthtime');\n try {\n fs.unlinkSync('testbirthtime');\n } catch (error) {}\n if (after.birthtime.getTime() === before.birthtime.getTime()) {\n console.log('===========');\n console.log('TEST PASSED');\n console.log('stats.birthtime stayed the same after chmod');\n } else {\n console.log('===========');\n console.log('TEST FAILED');\n console.log('stats.birthtime after chmod !== stats.birthtime at creation');\n if (after.birthtime.getTime() \u003e before.birthtime.getTime()) {\n console.log('stats.birthtime has gone forward in time');\n } else {\n console.log('stats.birthtime has gone backward in time');\n }\n if (after.mtime.getTime() === before.mtime.getTime()) {\n console.log('stats.mtime stayed the same after chmod');\n }\n if (after.birthtime.getTime() === after.ctime.getTime()) {\n console.log('stats.birthtime now equals newer stats.ctime');\n console.log('where birthtime is not supported by filesystem:');\n console.log(' stats.birthtime should be earlier of stats.mtime and stats.ctime');\n }\n }\n },\n 3000\n);\n```\n","author":{"url":"https://github.com/jorangreef","@type":"Person","name":"jorangreef"},"datePublished":"2015-07-22T14:49:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/2222/node/issues/2222"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:67451b8d-6eb2-d672-84c0-3f990a8b0091 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94E4:6435C:1FD89DC:2BA8FD5:6A4ECF43 |
| html-safe-nonce | ee2670cfc4152ee7a770e3140aef0ec7fdabb63e7ee9a80ad9cbf529b099dca4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEU0OjY0MzVDOjFGRDg5REM6MkJBOEZENTo2QTRFQ0Y0MyIsInZpc2l0b3JfaWQiOiIyOTgzNDc1MzUxNTAwMjc5NjE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ae1828b13e7832507ca1255cc24ba285d40a8a371a5b7a788402d7a474c8b6a4 |
| hovercard-subject-tag | issue:96586470 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/2222/issue_layout |
| twitter:image | https://opengraph.githubassets.com/01892bb79d115b32a1030f5157ed3c364ac6dfc57b8e313aa082c2eddad6c05d/nodejs/node/issues/2222 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/01892bb79d115b32a1030f5157ed3c364ac6dfc57b8e313aa082c2eddad6c05d/nodejs/node/issues/2222 |
| og:image:alt | stats.birthtime tracks ctime on filesystems which do not support birthtime, even if stats.ctime > stats.mtime or stats.ctime > stats.atime. It would be better in this case if stats.birthtime be set... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jorangreef |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width