1. test program & results

$ cat TestChmod.rb
#!/usr/bin/env jruby

require 'java'

system("touch ./atest.tmp")

file = java::io::File.new("./atest.tmp")
org::jruby::util::Chmod.chmod(file, "755")
system("ls -l ./atest.tmp")

File.chmod(0755, "./atest.tmp")
system("ls -l ./atest.tmp")

system("chmod 755 ./atest.tmp")
system("ls -l ./atest.tmp")

$ ./TestChmod.rb
-rwx-wx-wx 1 p2nexe p2nexe 0  9月 3日 16:39 ./atest.tmp
-rwx-wx-wx 1 p2nexe p2nexe 0  9月 3日 16:39 ./atest.tmp
-rwxr-xr-x 1 p2nexe p2nexe 0  9月 3日 16:39 ./atest.tmp

2. place of bugs ?

jruby-1.0.1/src/org/jruby/util/Chmod.java

  Line#    code
  -------------------------------------
   87      if ((permValue & 2) != 0) { 
   93      if ((permValue & 4) != 0) { 

I think that it is correct to do as follows. 

  Line#    code
  -------------------------------------
   87      if ((permValue & 4) != 0) { 
   93      if ((permValue & 2) != 0) { 


-- 
View this message in context: 
http://www.nabble.com/problem-in-chmod---tf4371015.html#a12458413
Sent from the JRuby - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to