You can change the owner and group of a file with the chown method
# It is like the Unix/Linux command chown.
# You need superuser or root privileges to use this method.
file = File.new( "books.txt", "r" )
file.chown( 109, 3333 )
file = File.new( "books.txt", "r" ).chown( 109, 3333 )
Related examples in the same category