Method: Unix::File#chown

Defined in:
lib/beaker/host/unix/file.rb

#chown(user, path, recursive = false) ⇒ Beaker::Result

Note:

To maintain argument order consistency with the underlying syscall, avoid having to specify nil arguments, and not do anything hacky with the arguments list, this method does not allow you to modify group ownership. Use Host::chgrp instead.

Change user ownership of a path

Parameters:

  • user (String)

    User to chown to

  • path (String)

    Path to chown

  • recursive (Boolean) (defaults to: false)

    Whether to pass the recursive flag

Returns:

See Also:



29
30
31
# File 'lib/beaker/host/unix/file.rb', line 29

def chown(user, path, recursive = false)
  execute("chown #{recursive ? '-R ' : ''}#{user} #{path}")
end