File Directory Ruby

File.lstat('test_file').mode & 0777       # Keep only the permission bits.
# => 420                                  # That is, 0644 octal.