pub fn remove_dir_contents<P: AsRef<Path>>(path: P) -> Result<()>
Expand description

Deletes the contents of path, but not the directory itself. It is an error if path is not a directory.

This is subject to file system races: a privileged process could be attacked by replacing parent directories of the supplied path with a link (e.g. to /etc). Consider using RemoveDir::remove_dir_contents() instead.