# ensure_dir

Ensure a directory exists. Returns error if it doesn't exist or is not a directory.

```rhai
ensure_dir(path: &str) -> String
```

## Examples

```rhai
ensure_dir("/var/log/myapp")?;
print("Log directory exists");
```

```rhai
ensure_dir("/opt/myapp/data")?;
```
