From efd36678e6041593a6b9cd64bdbe4318f1e7ad0e Mon Sep 17 00:00:00 2001 From: sorah Date: Mon, 15 May 2017 12:18:55 +0000 Subject: [PATCH] [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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file.c b/file.c index c576c85c0a..b234910d5d 100644 --- a/file.c +++ b/file.c @@ -372,6 +372,9 @@ apply2files(void (*func)(const char *, VALUE, void *), int argc, VALUE *argv, vo * Returns the pathname used to create file as a string. Does * not normalize the name. * + * The pathname may not point the file corresponding to file. + * e.g. file has been moved, deleted, or created with File::TMPFILE option. + * * File.new("testfile").path #=> "testfile" * File.new("/tmp/../tmp/xxx", "w").path #=> "/tmp/../tmp/xxx" *