Skip to content

Instantly share code, notes, and snippets.

@sho-h
Created January 21, 2015 00:23
Show Gist options
  • Save sho-h/ed24a80cdb2cf21d5c12 to your computer and use it in GitHub Desktop.
Save sho-h/ed24a80cdb2cf21d5c12 to your computer and use it in GitHub Desktop.
Fix File#birthtime and File.birthtime on Windows
Index: file.c
===================================================================
--- file.c (revision 49353)
+++ file.c (working copy)
@@ -2193,10 +2193,10 @@
*
* _file_name_ can be an IO object.
*
- * Note that on Windows (NTFS), returns creation time (birth time).
- *
* File.birthtime("testfile") #=> Wed Apr 09 08:53:13 CDT 2003
*
+ * If the platform doesn't have birthtime, raises NotImplementedError.
+ *
*/
static VALUE
@@ -2221,10 +2221,10 @@
*
* Returns the birth time for <i>file</i>.
*
- * Note that on Windows (NTFS), returns creation time (birth time).
- *
* File.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003
*
+ * If the platform doesn't have birthtime, raises NotImplementedError.
+ *
*/
static VALUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment