Struct inapi::Directory [] [src]

pub struct Directory { /* fields omitted */ }

Primitive for managing directories.

Examples

Initialise a new Host:

let mut host = Host::connect("hosts/myhost.json").unwrap();

Now you can setup a directory on your managed host:

let dir = Directory::new(&mut host, "/path/to/dir").unwrap();
dir.create(&mut host, Some(&[DirectoryOpts::DoRecursive])).unwrap();
dir.set_owner(&mut host, "MyUser", "MyGroup").unwrap();
dir.set_mode(&mut host, 755).unwrap();

Methods

impl Directory
[src]

[src]

Create a new Directory struct.

[src]

Check if the directory exists.

[src]

Create the directory.

[src]

Delete the directory.

[src]

Move the directory to a new path.

[src]

Get the directory's owner.

[src]

[src]

Get the directory's permissions mask.

[src]

Set the directory's permissions mask.