@@ -543,12 +543,12 @@ Experimental
543
543
544
544
### Description
545
545
546
- It creates an empty directory.
546
+ It creates an empty directory with default permissions .
547
547
It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
548
548
549
549
### Syntax
550
550
551
- ` call [[stdlib_system(module):make_directory(subroutine)]] (path, mode, err) `
551
+ ` call [[stdlib_system(module):make_directory(subroutine)]] (path [, err] ) `
552
552
553
553
### Class
554
554
@@ -558,13 +558,11 @@ Subroutine
558
558
559
559
` path ` : Shall be a character string containing the path of the directory to create. It is an ` intent(in) ` argument.
560
560
561
- ` mode ` : Shall be a scalar integer indicating the permission bits required (Not applicable to Windows). It is an ` optional, intent(in) ` argument.
562
-
563
- ` err ` : Shall be of type ` state_type ` , for error handling. It is an ` optional, intent(out) ` argument.
561
+ ` err ` (optional): Shall be of type ` state_type ` , and is used for error handling. It is an ` optional, intent(out) ` argument.
564
562
565
563
### Return values
566
564
567
- The ` err ` is set accordingly .
565
+ ` err ` is an optional state return flag. If not requested and an error occurs, an ` FS_ERROR ` will trigger an error stop .
568
566
569
567
### Example
570
568
@@ -574,20 +572,20 @@ The `err` is set accordingly.
574
572
575
573
---
576
574
577
- ## ` remove_directory ` - Removes an empty directory
575
+ ## ` make_directory_all ` - Creates an empty directory with all its parent directories
578
576
579
577
### Status
580
578
581
579
Experimental
582
580
583
581
### Description
584
582
585
- It deletes an empty directory.
586
- It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted .
583
+ It creates an empty directory with default permissions .
584
+ It also creates all the necessary parent directories in the path if they do not exist already .
587
585
588
586
### Syntax
589
587
590
- ` call [[stdlib_system(module):remove_directory (subroutine)]] (path, err) `
588
+ ` call [[stdlib_system(module):make_directory_all (subroutine)]] (path [, err] ) `
591
589
592
590
### Class
593
591
@@ -597,79 +595,79 @@ Subroutine
597
595
598
596
` path ` : Shall be a character string containing the path of the directory to create. It is an ` intent(in) ` argument.
599
597
600
- ` err ` : Shall be of type ` state_type ` , for error handling. It is an ` intent(out) ` argument.
598
+ ` err ` (optional) : Shall be of type ` state_type ` , and is used for error handling. It is an ` optional, intent(out)` argument.
601
599
602
600
### Return values
603
601
604
- The ` err ` is set accordingly .
602
+ ` err ` is an optional state return flag. If not requested and an error occurs, an ` FS_ERROR ` will trigger an error stop .
605
603
606
604
### Example
607
605
608
606
``` fortran
609
- {!example/system/example_remove_directory .f90!}
607
+ {!example/system/example_make_directory .f90!}
610
608
```
611
609
612
610
---
613
611
614
- ## ` get_cwd ` - Gets the current working directory
612
+ ## ` remove_directory ` - Removes an empty directory
615
613
616
614
### Status
617
615
618
616
Experimental
619
617
620
618
### Description
621
619
622
- It gets the current working directory associated with the process calling this subroutine .
620
+ It deletes an empty directory.
623
621
It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
624
622
625
623
### Syntax
626
624
627
- ` call [[stdlib_system(module):get_cwd (subroutine)]] (cwd , err) `
625
+ ` call [[stdlib_system(module):remove_directory (subroutine)]] (path , err) `
628
626
629
627
### Class
630
628
631
629
Subroutine
632
630
633
631
### Arguments
634
632
635
- ` cwd ` : Shall be a character string containing the path of the current working directory (cwd) . It is an ` intent(out ) ` argument.
633
+ ` path ` : Shall be a character string containing the path of the directory to create . It is an ` intent(in ) ` argument.
636
634
637
- ` err ` : Shall be of type ` state_type ` , for error handling. It is an ` intent(out) ` argument.
635
+ ` err ` (optional) : Shall be of type ` state_type ` , and is used for error handling. It is an ` optional, intent(out)` argument.
638
636
639
637
### Return values
640
638
641
- The ` err ` is set accordingly .
639
+ ` err ` is an optional state return flag. On error if not requested, an ` FS_ERROR ` will trigger an error stop .
642
640
643
641
### Example
644
642
645
643
``` fortran
646
- {!example/system/example_cwd .f90!}
644
+ {!example/system/example_remove_directory .f90!}
647
645
```
648
646
649
647
---
650
648
651
- ## ` set_cwd ` - Sets the current working directory
649
+ ## ` get_cwd ` - Gets the current working directory
652
650
653
651
### Status
654
652
655
653
Experimental
656
654
657
655
### Description
658
656
659
- It sets the current working directory associated with the process calling this subroutine.
657
+ It gets the current working directory associated with the process calling this subroutine.
660
658
It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
661
659
662
660
### Syntax
663
661
664
- ` call [[stdlib_system(module):set_cwd (subroutine)]] (path , err) `
662
+ ` call [[stdlib_system(module):get_cwd (subroutine)]] (cwd , err) `
665
663
666
664
### Class
667
665
668
666
Subroutine
669
667
670
668
### Arguments
671
669
672
- ` path ` : Shall be a character string containing the path of the directory. It is an ` intent(in ) ` argument.
670
+ ` cwd ` : Shall be a character string containing the path of the current working directory (cwd) . It is an ` intent(out ) ` argument.
673
671
674
672
` err ` : Shall be of type ` state_type ` , for error handling. It is an ` intent(out) ` argument.
675
673
@@ -685,42 +683,43 @@ The `err` is set accordingly.
685
683
686
684
---
687
685
688
- ## ` null_device ` - Return the null device file path
686
+ ## ` set_cwd ` - Sets the current working directory
689
687
690
688
### Status
691
689
692
690
Experimental
693
691
694
692
### Description
695
693
696
- This function returns the file path of the null device, which is a special file used to discard any data written to it.
697
- It reads as an empty file. The null device's path varies by operating system:
698
- - On Windows, the null device is represented as ` NUL ` .
699
- - On UNIX-like systems (Linux, macOS), the null device is represented as ` /dev/null ` .
694
+ It sets the current working directory associated with the process calling this subroutine.
695
+ It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
700
696
701
697
### Syntax
702
698
703
- ` path = ` [[ stdlib_system(module): null_device (function )]] ` ( )`
699
+ ` call [[stdlib_system(module):set_cwd(subroutine )]] (path, err )`
704
700
705
701
### Class
706
702
707
- Function
703
+ Subroutine
708
704
709
705
### Arguments
710
706
711
- None .
707
+ ` path ` : Shall be a character string containing the path of the directory. It is an ` intent(in) ` argument .
712
708
713
- ### Return Value
709
+ ` err ` : Shall be of type ` state_type ` , for error handling. It is an ` intent(out) ` argument.
714
710
715
- - ** Type:** ` character(:), allocatable `
716
- - Returns the null device file path as a character string, appropriate for the operating system.
711
+ ### Return values
712
+
713
+ The ` err ` is set accordingly.
717
714
718
715
### Example
719
716
720
717
``` fortran
721
- {!example/system/example_null_device .f90!}
718
+ {!example/system/example_cwd .f90!}
722
719
```
723
720
721
+ ---
722
+
724
723
## ` delete_file ` - Delete a file
725
724
726
725
### Status
0 commit comments