(
_state: &mut State<'gc>,
args: Vec<Value<'gc>>,
)
| 191 | } |
| 192 | |
| 193 | fn io_remove_dir<'gc>( |
| 194 | _state: &mut State<'gc>, |
| 195 | args: Vec<Value<'gc>>, |
| 196 | ) -> Result<Value<'gc>, VmError> { |
| 197 | let path = string_arg!(args, 0, "remove_dir")?.to_string(); |
| 198 | let recursive = args.get(1).map(|v| v.as_boolean()).unwrap_or(false); |
| 199 | |
| 200 | if recursive { |
| 201 | fs::remove_dir_all(&path) |
| 202 | } else { |
| 203 | fs::remove_dir(&path) |
| 204 | } |
| 205 | .map_err(|e| VmError::RuntimeError(format!("Failed to remove directory '{}': {}", path, e)))?; |
| 206 | |
| 207 | Ok(Value::Boolean(true)) |
| 208 | } |
| 209 | |
| 210 | fn io_rename<'gc>(_state: &mut State<'gc>, args: Vec<Value<'gc>>) -> Result<Value<'gc>, VmError> { |
| 211 | let from = string_arg!(args, 0, "rename")?.to_string(); |
nothing calls this directly
no test coverage detected