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 @@ -532,6 +532,80 @@ The `err` is set accordingly.
532532
533533---
534534
535+ ## ` get_cwd ` - Gets the current working directory
536+
537+ ### Status
538+
539+ Experimental
540+
541+ ### Description
542+
543+ It gets the current working directory associated with the process calling this subroutine.
544+ It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
545+
546+ ### Syntax
547+
548+ ` call [[stdlib_system(module):get_cwd(subroutine)]] (cwd, err) `
549+
550+ ### Class
551+
552+ Subroutine
553+
554+ ### Arguments
555+
556+ ` cwd ` : Shall be a character string containing the path of the current working directory (cwd). It is an ` intent(out) ` argument.
557+
558+ ` err ` : Shall be of type ` state_type ` , for error handling. It is an ` intent(out) ` argument.
559+
560+ ### Return values
561+
562+ The ` err ` is set accordingly.
563+
564+ ### Example
565+
566+ ``` fortran
567+ {!example/system/example_cwd.f90!}
568+ ```
569+
570+ ---
571+
572+ ## ` set_cwd ` - Sets the current working directory
573+
574+ ### Status
575+
576+ Experimental
577+
578+ ### Description
579+
580+ It sets the current working directory associated with the process calling this subroutine.
581+ It is designed to work across multiple platforms. On Windows, paths with both forward ` / ` and backward ` \ ` slashes are accepted.
582+
583+ ### Syntax
584+
585+ ` call [[stdlib_system(module):set_cwd(subroutine)]] (path, err) `
586+
587+ ### Class
588+
589+ Subroutine
590+
591+ ### Arguments
592+
593+ ` path ` : Shall be a character string containing the path of the directory. It is an ` intent(in) ` argument.
594+
595+ ` err ` : Shall be of type ` state_type ` , for error handling. It is an ` intent(out) ` argument.
596+
597+ ### Return values
598+
599+ The ` err ` is set accordingly.
600+
601+ ### Example
602+
603+ ``` fortran
604+ {!example/system/example_cwd.f90!}
605+ ```
606+
607+ ---
608+
535609## ` null_device ` - Return the null device file path
536610
537611### 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