10 if _chmod(path, mode) != 0
16 if JRuby::FFI::Platform::IS_WINDOWS
17 attach_function :_chmod, :_chmod, [ :string, :int ], :int
19 attach_function :chmod, :_chmod, [ :string, :int ], :int
28 extend JRuby::FFI::Library
33 puts "Benchmark FFI chmod (rubinius api) performance, #{iter}x changing mode"
35 puts Benchmark.measure {
36 iter.times { RbxPosix.chmod(0622, file) }
39 puts "Benchmark FFI chmod (jruby api) performance, #{iter}x changing mode"
41 puts Benchmark.measure {
42 iter.times { JPosix.chmod(0622, file) }
46 puts "Benchmark JRuby File.chmod performance, #{iter}x changing mode"
48 puts Benchmark.measure {
49 iter.times { File.chmod(0622, file) }