@@ -535,6 +535,191 @@ The function returns a `logical` value:
535
535
536
536
---
537
537
538
+ ## ` make_directory ` - Creates an empty directory
539
+
540
+ ### Status
541
+
542
+ Experimental
543
+
544
+ ### Description
545
+
546
+ It creates an empty directory with default permissions.
547
+ It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
548
+
549
+ ### Syntax
550
+
551
+ ` call [[stdlib_system(module):make_directory(subroutine)]] (path [,err]) `
552
+
553
+ ### Class
554
+
555
+ Subroutine
556
+
557
+ ### Arguments
558
+
559
+ ` path ` : Shall be a character string containing the path of the directory to create. It is an ` intent(in) ` argument.
560
+
561
+ ` err ` (optional): Shall be of type ` state_type ` , and is used for error handling. It is an ` optional, intent(out) ` argument.
562
+
563
+ ### Return values
564
+
565
+ ` err ` is an optional state return flag. If not requested and an error occurs, an ` FS_ERROR ` will trigger an error stop.
566
+
567
+ ### Example
568
+
569
+ ``` fortran
570
+ {!example/system/example_make_directory.f90!}
571
+ ```
572
+
573
+ ---
574
+
575
+ ## ` make_directory_all ` - Creates an empty directory with all its parent directories
576
+
577
+ ### Status
578
+
579
+ Experimental
580
+
581
+ ### Description
582
+
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.
585
+
586
+ ### Syntax
587
+
588
+ ` call [[stdlib_system(module):make_directory_all(subroutine)]] (path [,err]) `
589
+
590
+ ### Class
591
+
592
+ Subroutine
593
+
594
+ ### Arguments
595
+
596
+ ` path ` : Shall be a character string containing the path of the directory to create. It is an ` intent(in) ` argument.
597
+
598
+ ` err ` (optional): Shall be of type ` state_type ` , and is used for error handling. It is an ` optional, intent(out) ` argument.
599
+
600
+ ### Return values
601
+
602
+ ` err ` is an optional state return flag. If not requested and an error occurs, an ` FS_ERROR ` will trigger an error stop.
603
+
604
+ ### Example
605
+
606
+ ``` fortran
607
+ {!example/system/example_make_directory.f90!}
608
+ ```
609
+
610
+ ---
611
+
612
+ ## ` remove_directory ` - Removes an empty directory
613
+
614
+ ### Status
615
+
616
+ Experimental
617
+
618
+ ### Description
619
+
620
+ It deletes an empty directory.
621
+ It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
622
+
623
+ ### Syntax
624
+
625
+ ` call [[stdlib_system(module):remove_directory(subroutine)]] (path, err) `
626
+
627
+ ### Class
628
+
629
+ Subroutine
630
+
631
+ ### Arguments
632
+
633
+ ` path ` : Shall be a character string containing the path of the directory to create. It is an ` intent(in) ` argument.
634
+
635
+ ` err ` (optional): Shall be of type ` state_type ` , and is used for error handling. It is an ` optional, intent(out) ` argument.
636
+
637
+ ### Return values
638
+
639
+ ` err ` is an optional state return flag. On error if not requested, an ` FS_ERROR ` will trigger an error stop.
640
+
641
+ ### Example
642
+
643
+ ``` fortran
644
+ {!example/system/example_remove_directory.f90!}
645
+ ```
646
+
647
+ ---
648
+
649
+ ## ` get_cwd ` - Gets the current working directory
650
+
651
+ ### Status
652
+
653
+ Experimental
654
+
655
+ ### Description
656
+
657
+ This subroutine retrieves the current working directory the running process is executing from.
658
+ It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
659
+
660
+ ### Syntax
661
+
662
+ ` call [[stdlib_system(module):get_cwd(subroutine)]] (cwd [, err]) `
663
+
664
+ ### Class
665
+
666
+ Subroutine
667
+
668
+ ### Arguments
669
+
670
+ ` cwd ` : Shall be a character string for receiving the path of the current working directory (cwd). It is an ` intent(out) ` argument.
671
+
672
+ ` err ` (optional): Shall be of type ` state_type ` , and is used for error handling. It is an ` intent(out) ` argument.
673
+
674
+ ### Return values
675
+
676
+ ` err ` is an optional state return flag. On error if not requested, an ` FS_ERROR ` will trigger an error stop.
677
+
678
+ ### Example
679
+
680
+ ``` fortran
681
+ {!example/system/example_cwd.f90!}
682
+ ```
683
+
684
+ ---
685
+
686
+ ## ` set_cwd ` - Sets the current working directory
687
+
688
+ ### Status
689
+
690
+ Experimental
691
+
692
+ ### Description
693
+
694
+ This subrotine sets the current working directory the process is executing from.
695
+ It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
696
+
697
+ ### Syntax
698
+
699
+ ` call [[stdlib_system(module):set_cwd(subroutine)]] (path [, err]) `
700
+
701
+ ### Class
702
+
703
+ Subroutine
704
+
705
+ ### Arguments
706
+
707
+ ` path ` : Shall be a character string containing the path of the directory. It is an ` intent(in) ` argument.
708
+
709
+ ` err ` (optional): Shall be of type ` state_type ` , and is used for error handling. It is an ` intent(out) ` argument.
710
+
711
+ ### Return values
712
+
713
+ ` err ` is an optional state return flag. On error if not requested, an ` FS_ERROR ` will trigger an error stop.
714
+
715
+ ### Example
716
+
717
+ ``` fortran
718
+ {!example/system/example_cwd.f90!}
719
+ ```
720
+
721
+ ---
722
+
538
723
## ` null_device ` - Return the null device file path
539
724
540
725
### Status
@@ -571,6 +756,8 @@ None.
571
756
{!example/system/example_null_device.f90!}
572
757
```
573
758
759
+ ---
760
+
574
761
## ` delete_file ` - Delete a file
575
762
576
763
### Status
@@ -612,6 +799,8 @@ The file is removed from the filesystem if the operation is successful. If the o
612
799
{!example/system/example_delete_file.f90!}
613
800
```
614
801
802
+ ---
803
+
615
804
## ` join_path ` - Joins the provided paths according to the OS
616
805
617
806
### Status
@@ -674,6 +863,8 @@ The result is an `allocatable` character string or `type(string_type)`
674
863
{!example/system/example_path_join.f90!}
675
864
```
676
865
866
+ ---
867
+
677
868
## ` split_path ` - splits a path immediately following the last separator
678
869
679
870
### Status
@@ -714,6 +905,8 @@ The splitted path. `head` and `tail`.
714
905
{!example/system/example_path_split_path.f90!}
715
906
```
716
907
908
+ ---
909
+
717
910
## ` base_name ` - The last part of a path
718
911
719
912
### Status
@@ -749,6 +942,8 @@ A character string or `type(string_type)`.
749
942
{!example/system/example_path_base_name.f90!}
750
943
```
751
944
945
+ ---
946
+
752
947
## ` dir_name ` - Everything except the last part of the path
753
948
754
949
### Status
0 commit comments