Ruby/File Directory/chown

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

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 )
# or: 
file = File.new( "books.txt", "r" ).chown( 109, 3333 )