Index: io.c =================================================================== --- io.c (リビジョン 37718) +++ io.c (作業コピー) @@ -136,6 +136,8 @@ VALUE rb_output_rs; VALUE rb_default_rs; +extern VALUE rb_mFConst; + static VALUE argf; static ID id_write, id_read, id_getc, id_flush, id_readpartial, id_set_encoding; @@ -11632,7 +11634,10 @@ rb_define_method(rb_cFile, "initialize", rb_file_initialize, -1); /* open for reading only */ + rb_define_const(rb_mFConst, "RDONLY", INT2FIX(O_RDONLY)); +#if 0 rb_file_const("RDONLY", INT2FIX(O_RDONLY)); +#endif /* open for writing only */ rb_file_const("WRONLY", INT2FIX(O_WRONLY)); /* open for reading and writing */ Index: file.c =================================================================== --- file.c (リビジョン 37718) +++ file.c (作業コピー) @@ -5513,9 +5513,20 @@ rb_define_method(rb_cFile, "flock", rb_file_flock, 1); + /* + * Document-module: File::Constants + * + * foo bar. + */ rb_mFConst = rb_define_module_under(rb_cFile, "Constants"); rb_include_module(rb_cIO, rb_mFConst); + + /* shared lock */ + rb_define_const(rb_mFConst, "LOCK_SH", INT2FIX(LOCK_SH)); +#if 0 rb_file_const("LOCK_SH", INT2FIX(LOCK_SH)); +#endif + /* exclusive lock */ rb_file_const("LOCK_EX", INT2FIX(LOCK_EX)); rb_file_const("LOCK_UN", INT2FIX(LOCK_UN)); rb_file_const("LOCK_NB", INT2FIX(LOCK_NB));