Changing File Modes and Owner : chmod « File Directory « Ruby






Changing File Modes and Owner


To change the mode (permissions or access list) of a file, use the chmod method with a mask

file = File.new( "books.txt", "w" )
file.chmod( 0755 )

 








Related examples in the same category

1.Masks for chmod
2.Change mode and use system command to check
3.Change file mode to 0644
4.Changing the Permissions on a File
5.Take away the world's read access.
6.Give everyone access to everything
7.Take away the world's write and execute access