ruby-changes:46619
From: sorah <ko1@a...>
Date: Mon, 15 May 2017 21:19:03 +0900 (JST)
Subject: [ruby-changes:46619] sorah:r58734 (trunk): [DOC] File#path result can be inaccurate
sorah 2017-05-15 21:18:55 +0900 (Mon, 15 May 2017) New Revision: 58734 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58734 Log: [DOC] File#path result can be inaccurate * file.c(rb_file_path): [DOC] Note that the pathname returned by this method can be inaccurate, for instance file gets moved, renamed, deleted or is created with File::TMPFILE option. Relates to [Feature #13568] Modified files: trunk/file.c Index: file.c =================================================================== --- file.c (revision 58733) +++ file.c (revision 58734) @@ -372,6 +372,9 @@ apply2files(void (*func)(const char *, V https://github.com/ruby/ruby/blob/trunk/file.c#L372 * Returns the pathname used to create <i>file</i> as a string. Does * not normalize the name. * + * The pathname may not point the file corresponding to <i>file</i>. + * e.g. file has been moved, deleted, or created with <code>File::TMPFILE</code> option. + * * File.new("testfile").path #=> "testfile" * File.new("/tmp/../tmp/xxx", "w").path #=> "/tmp/../tmp/xxx" * -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/