Kenel.test('a')

test $B$K(B ‘e’ $B%3%^%s%I$HF1$88z2L$H$7$F(B ‘a’
$B$N%(%s%H%j$,$"$j$^$9$,A0CJ3,$N(B
$B%A%’%C%/$G<B:]$K$O5!G=$7$^$;$s!#(B

$B$3$l$OM-8z$K$7$?$[$&$,$$$$$N$+!"%(%s%H%j$r:o=|$7$?$[$&$,$$$$$N$+!"$I$C(B
$B$A$G$7$g$&$+!#(Bbash $B$N(B builtin $B$J$I$K$O$"$k$h$&$G$9$,!#(B

Index: file.c

— file.c ($B%j%S%8%g%s(B 45822)
+++ file.c ($B:n6H%3%T!<(B)
@@ -4527,6 +4527,7 @@

  • File tests on a single file:
  • Cmd Returns Meaning
    • “a” | boolean | True if file1 exists
    • “A” | Time | Last access time for file1
    • “b” | boolean | True if file1 is a block device
    • “c” | boolean | True if file1 is a character device
      @@ -4592,7 +4593,7 @@
      rb_raise(rb_eArgError, “unknown command “\x%02X””, cmd);
      }
      }
  • if (strchr(“bcdefgGkloOprRsSuwWxXz”, cmd)) {
  • if (strchr(“bcdaefgGkloOprRsSuwWxXz”, cmd)) {
    CHECK(1);
    switch (cmd) {
    case ‘b’:
    Index: test/ruby/test_file_exhaustive.rb
    ===================================================================
    — test/ruby/test_file_exhaustive.rb ($B%j%S%8%g%s(B 45822)
    +++ test/ruby/test_file_exhaustive.rb ($B:n6H%3%T!<(B)
    @@ -942,6 +942,7 @@
    assert_equal(File.blockdev?(f), test(?b, f))
    assert_equal(File.chardev?(f), test(?c, f))
    assert_equal(File.directory?(f), test(?d, f))
  •  assert_equal(File.exist?(f), test(?a, f))
     assert_equal(File.exist?(f), test(?e, f))
     assert_equal(File.file?(f), test(?f, f))
     assert_equal(File.setgid?(f), test(?g, f))

$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message “Re: [ruby-dev:48172] Kenel.test(‘a’)”
on Mon, 05 May 2014 13:38:01 +0900 (JST), Tadayoshi F.
[email protected] writes:
|
|test $B$K(B ‘e’ $B%3%^%s%I$HF1$88z2L$H$7$F(B ‘a’
$B$N%(%s%H%j$,$“$j$^$9$,A0CJ3,$N(B
|$B%A%'%C%/$G<B:]$K$O5!G=$7$^$;$s!#(B
|
|$B$3$l$OM-8z$K$7$?$[$&$,$$$$$N$+!”%(%s%H%j$r:o=|$7$?$[$&$,$$$$$N$+!“$I$C(B
|$B$A$G$7$g$&$+!#(Bbash $B$N(B builtin $B$J$I$K$O$”$k$h$&$G$9$,!#(B

$B$7$i$Y$?$i(B-a$B$O(Bdeprecated$B$i$7$$$N$G!"$$$^$5$i;H$($k$h$&$K$9$k(B
$BI,MW$O$J$5$=$&$G$9!#:o=|$NJ}8~$G!#(B