def copy(self, *paths, **options): """Copy **src** file or directory to **dst**. *paths and **options contains options that can be passed to the command. **options can contain an additionnal key *INTERACTIVE* that will be pass to ``execute`` function.""" paths = [escape(path) for path in paths] return self.execute('cp', *paths, **options)
def chmod(self, permissions, *paths, **options): paths = [escape(path) for path in paths] return self.execute('chmod', permissions, *paths, **options)
def remove(self, *paths, **options): paths = [escape(path) for path in paths] return self.execute('rm', *paths, **options)
def mkdir(self, *paths, **options): """Create a directory. *args and **options contains options that can be passed to the command. **options can contain an additionnal key *INTERACTIVE* that will be pass to ``execute`` function.""" paths = [escape(path) for path in paths] return self.execute('mkdir', *paths, **options)
def touch(self, *paths, **options): paths = [escape(path) for path in paths] return self.execute('touch', *paths, **options)
def mount(self, device, mount_point, **options): mount_point = escape(mount_point) return self.execute('mount', device, mount_point, **options)
def chgrp(self, group, *paths, **options): paths = [escape(path) for path in paths] return self.execute('chgrp', group, *path, **options)
def chown(self, owner, *paths, **options): paths = [escape(path) for path in paths] return self.execute('chown', owner, *paths, **options)
def umount(self, mount_point, **options): mount_point = escape(mount_point) return self.execute('umount', mount_point, **options)
def list(self, path, **opts): status, stdout, stderr = self.execute('ls', escape(path), **opts) if not status: raise OSError(stderr) return stdout