File tree Expand file tree Collapse file tree 2 files changed +75
-1
lines changed Expand file tree Collapse file tree 2 files changed +75
-1
lines changed Original file line number Diff line number Diff line change @@ -646,6 +646,80 @@ Subroutine
646646
647647---
648648
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+
649723## ` null_device ` - Return the null device file path
650724
651725### Status
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ char* stdlib_get_cwd(size_t* len, int* stat){
5858 return NULL ;
5959 }
6060
61- * len = strlen (buffer )
61+ * len = strlen (buffer );
6262 return buffer ;
6363#else
6464 char buffer [PATH_MAX + 1 ];
You can’t perform that action at this time.
0 commit comments