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
Copy file name to clipboardExpand all lines: doc/specs/stdlib_io.md
-54
Original file line number
Diff line number
Diff line change
@@ -302,57 +302,3 @@ Exceptions trigger an `error stop` unless the optional `err` argument is provide
302
302
{!example/io/example_get_file.f90!}
303
303
```
304
304
305
-
## `delete_file` - Delete a file
306
-
307
-
### Status
308
-
309
-
Experimental
310
-
311
-
### Description
312
-
313
-
This subroutine deletes a specified file from the filesystem. It ensures that the file exists and is not a directory before attempting deletion.
314
-
If the file cannot be deleted due to permissions, being a directory, or other issues, an error is raised.
315
-
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.
327
-
328
-
`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.
329
-
330
-
### Behavior
331
-
332
-
- Checks if the file exists. If not, an error is raised.
333
-
- Ensures the path is not a directory before deletion.
334
-
- Attempts to delete the file, raising an error if unsuccessful.
335
-
336
-
### Return values
337
-
338
-
The file is removed from the filesystem if the operation is successful. If the operation fails, an error is raised.
Copy file name to clipboardExpand all lines: doc/specs/stdlib_system.md
+54
Original file line number
Diff line number
Diff line change
@@ -492,3 +492,57 @@ None.
492
492
{!example/system/example_null_device.f90!}
493
493
```
494
494
495
+
## `delete_file` - Delete a file
496
+
497
+
### Status
498
+
499
+
Experimental
500
+
501
+
### Description
502
+
503
+
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