* [ruby-core:23194] [Feature #1377] Please provide constant File::NOATIME
@ 2009-04-13 17:19 Johan Walles
2009-04-13 17:25 ` [ruby-core:23195] " Johan Walles
2009-05-10 22:15 ` [ruby-core:23418] " Kazuhiro NISHIYAMA
0 siblings, 2 replies; 5+ messages in thread
From: Johan Walles @ 2009-04-13 17:19 UTC (permalink / raw
To: ruby-core
Feature #1377: Please provide constant File::NOATIME
http://redmine.ruby-lang.org/issues/show/1377
Author: Johan Walles
Status: Open, Priority: Normal
Category: core
I would like to be able to specify File::NOATIME mode when opening a file through File.new():
irb(main):001:0> f = File.new("file", File::RDONLY|File::NOATIME)
NameError: uninitialized constant File::NOATIME
from (irb):1
from :0
>From the open(2) man page:
O_NOATIME (Since Linux 2.6.8)
Do not update the file last access time (st_atime in the inode) when the file is read(2). This flag is intended for
use by indexing or backup programs, where its use can significantly reduce the amount of disk activity. This flag
may not be effective on all file systems. One example is NFS, where the server maintains the access time.
Here's the definition of O_NOATIME from /usr/include/bits/fcntl.h:
#ifdef __USE_GNU
# define O_DIRECT 040000 /* Direct disk access. */
# define O_DIRECTORY 0200000 /* Must be a directory. */
# define O_NOFOLLOW 0400000 /* Do not follow links. */
# define O_NOATIME 01000000 /* Do not set atime. */
# define O_CLOEXEC 02000000 /* Set close_on_exec. */
#endif
Thanks //Johan
Note to self: This is the upstream report for http://bugs.debian.org/518716
----------------------------------------
http://redmine.ruby-lang.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ruby-core:23195] [Feature #1377] Please provide constant File::NOATIME
2009-04-13 17:19 [ruby-core:23194] [Feature #1377] Please provide constant File::NOATIME Johan Walles
@ 2009-04-13 17:25 ` Johan Walles
2009-05-10 22:15 ` [ruby-core:23418] " Kazuhiro NISHIYAMA
1 sibling, 0 replies; 5+ messages in thread
From: Johan Walles @ 2009-04-13 17:25 UTC (permalink / raw
To: ruby-core
Issue #1377 has been updated by Johan Walles.
For the curious, my intended use for this is in http://launchpad.net/foton when scanning for images.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1377
----------------------------------------
http://redmine.ruby-lang.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ruby-core:23418] [Feature #1377] Please provide constant File::NOATIME
2009-04-13 17:19 [ruby-core:23194] [Feature #1377] Please provide constant File::NOATIME Johan Walles
2009-04-13 17:25 ` [ruby-core:23195] " Johan Walles
@ 2009-05-10 22:15 ` Kazuhiro NISHIYAMA
2009-05-10 23:14 ` [ruby-core:23419] " Yukihiro Matsumoto
1 sibling, 1 reply; 5+ messages in thread
From: Kazuhiro NISHIYAMA @ 2009-05-10 22:15 UTC (permalink / raw
To: ruby-core
Issue #1377 has been updated by Kazuhiro NISHIYAMA.
How about this patch?
Index: io.c
===================================================================
--- io.c (revision 23386)
+++ io.c (working copy)
@@ -8953,6 +8953,9 @@ Init_IO(void)
#ifdef O_NOFOLLOW
rb_file_const("NOFOLLOW", INT2FIX(O_NOFOLLOW)); /* FreeBSD, Linux */
#endif
+#ifdef O_NOATIME
+ rb_file_const("NOATIME", INT2FIX(O_NOATIME)); /* Linux */
+#endif
sym_mode = ID2SYM(rb_intern("mode"));
sym_perm = ID2SYM(rb_intern("perm"));
% ruby-trunk -e 'printf "%#o\n", File::NOATIME'
01000000
%
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1377
----------------------------------------
http://redmine.ruby-lang.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ruby-core:23419] Re: [Feature #1377] Please provide constant File::NOATIME
2009-05-10 22:15 ` [ruby-core:23418] " Kazuhiro NISHIYAMA
@ 2009-05-10 23:14 ` Yukihiro Matsumoto
2009-05-11 11:17 ` [ruby-core:23424] [Feature #1377](Closed) " Anonymous
0 siblings, 1 reply; 5+ messages in thread
From: Yukihiro Matsumoto @ 2009-05-10 23:14 UTC (permalink / raw
To: ruby-core
Hi,
In message "Re: [ruby-core:23418] [Feature #1377] Please provide constant File::NOATIME"
on Mon, 11 May 2009 07:15:47 +0900, Kazuhiro NISHIYAMA <redmine@ruby-lang.org> writes:
|Issue #1377 has been updated by Kazuhiro NISHIYAMA.
|
|How about this patch?
|
|Index: io.c
|===================================================================
|--- io.c (revision 23386)
|+++ io.c (working copy)
Can you check in?
matz.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ruby-core:23424] [Feature #1377](Closed) Please provide constant File::NOATIME
2009-05-10 23:14 ` [ruby-core:23419] " Yukihiro Matsumoto
@ 2009-05-11 11:17 ` Anonymous
0 siblings, 0 replies; 5+ messages in thread
From: Anonymous @ 2009-05-11 11:17 UTC (permalink / raw
To: ruby-core
Issue #1377 has been updated by Anonymous.
Status changed from Open to Closed
% Done changed from 0 to 100
Applied in changeset r23392.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1377
----------------------------------------
http://redmine.ruby-lang.org
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-11 11:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-13 17:19 [ruby-core:23194] [Feature #1377] Please provide constant File::NOATIME Johan Walles
2009-04-13 17:25 ` [ruby-core:23195] " Johan Walles
2009-05-10 22:15 ` [ruby-core:23418] " Kazuhiro NISHIYAMA
2009-05-10 23:14 ` [ruby-core:23419] " Yukihiro Matsumoto
2009-05-11 11:17 ` [ruby-core:23424] [Feature #1377](Closed) " Anonymous
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).