@@ -646,6 +646,80 @@ Subroutine
646
646
647
647
---
648
648
649
+ ## ` get_cwd ` - Gets the current working directory
650
+
651
+ ### Status
652
+
653
+ Experimental
654
+
655
+ ### Description
656
+
657
+ It gets the current working directory associated with the process calling this subroutine.
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 containing the path of the current working directory (cwd). It is an ` intent(out) ` argument.
671
+
672
+ ` err ` : Shall be of type ` state_type ` , for error handling. It is an ` intent(out) ` argument.
673
+
674
+ ### Return values
675
+
676
+ The ` err ` is set accordingly.
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
+ 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.
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 ` : Shall be of type ` state_type ` , for error handling. It is an ` intent(out) ` argument.
710
+
711
+ ### Return values
712
+
713
+ The ` err ` is set accordingly.
714
+
715
+ ### Example
716
+
717
+ ``` fortran
718
+ {!example/system/example_cwd.f90!}
719
+ ```
720
+
721
+ ---
722
+
649
723
## ` null_device ` - Return the null device file path
650
724
651
725
### Status
@@ -682,6 +756,8 @@ None.
682
756
{!example/system/example_null_device.f90!}
683
757
```
684
758
759
+ ---
760
+
685
761
## ` delete_file ` - Delete a file
686
762
687
763
### Status
@@ -723,6 +799,8 @@ The file is removed from the filesystem if the operation is successful. If the o
723
799
{!example/system/example_delete_file.f90!}
724
800
```
725
801
802
+ ---
803
+
726
804
## ` join_path ` - Joins the provided paths according to the OS
727
805
728
806
### Status
@@ -785,6 +863,8 @@ The result is an `allocatable` character string or `type(string_type)`
785
863
{!example/system/example_path_join.f90!}
786
864
```
787
865
866
+ ---
867
+
788
868
## ` split_path ` - splits a path immediately following the last separator
789
869
790
870
### Status
@@ -825,6 +905,8 @@ The splitted path. `head` and `tail`.
825
905
{!example/system/example_path_split_path.f90!}
826
906
```
827
907
908
+ ---
909
+
828
910
## ` base_name ` - The last part of a path
829
911
830
912
### Status
@@ -860,6 +942,8 @@ A character string or `type(string_type)`.
860
942
{!example/system/example_path_base_name.f90!}
861
943
```
862
944
945
+ ---
946
+
863
947
## ` dir_name ` - Everything except the last part of the path
864
948
865
949
### Status
0 commit comments