You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This subroutine deletes a specified file from the filesystem. It ensures that the file exists and is not a directory before attempting deletion.
504
+
If the file cannot be deleted due to permissions, being a directory, or other issues, an error is raised.
505
+
The function provides an optional error-handling mechanism via the `state_type` class. If the `err` argument is not provided, exceptions will trigger an `error stop`.
`path`: Shall be a character string containing the path to the file to be deleted. It is an `intent(in)` argument.
517
+
518
+
`err` (optional): Shall be a `type(state_type)` variable for error handling. If provided, errors are returned as a state object. If not provided, the program stops execution on error.
519
+
520
+
### Behavior
521
+
522
+
- Checks if the file exists. If not, an error is raised.
523
+
- Ensures the path is not a directory before deletion.
524
+
- Attempts to delete the file, raising an error if unsuccessful.
525
+
526
+
### Return values
527
+
528
+
The file is removed from the filesystem if the operation is successful. If the operation fails, an error is raised.
0 commit comments