@@ -165,7 +165,7 @@ module stdlib_system
165
165
! ! Gets the current working directory.
166
166
! !
167
167
! ! ### Description
168
- ! ! This subroutine gets the current working directory of the process calling this function .
168
+ ! ! This subroutine gets the current working directory the process is executing from .
169
169
! !
170
170
public :: get_cwd
171
171
@@ -178,7 +178,7 @@ module stdlib_system
178
178
! ! Changes the current working directory to the one specified.
179
179
! !
180
180
! ! ### Description
181
- ! ! This subroutine sets the current working directory of the process calling this function to the one specified .
181
+ ! ! This subroutine sets the current working directory the process is executing from .
182
182
! !
183
183
public :: set_cwd
184
184
@@ -1064,7 +1064,7 @@ end subroutine remove_directory
1064
1064
1065
1065
subroutine get_cwd (cwd , err )
1066
1066
character (:), allocatable , intent (out ) :: cwd
1067
- type (state_type), intent (out ) :: err
1067
+ type (state_type), optional , intent (out ) :: err
1068
1068
type (state_type) :: err0
1069
1069
1070
1070
interface
@@ -1082,7 +1082,7 @@ end function stdlib_get_cwd
1082
1082
c_str_ptr = stdlib_get_cwd(len, stat)
1083
1083
1084
1084
if (stat /= 0 ) then
1085
- err0 = state_type(STDLIB_FS_ERROR, " code: " , to_string( stat) // " , " , c_get_strerror())
1085
+ err0 = FS_ERROR_CODE( stat, c_get_strerror())
1086
1086
call err0% handle(err)
1087
1087
end if
1088
1088
@@ -1092,7 +1092,7 @@ end subroutine get_cwd
1092
1092
1093
1093
subroutine set_cwd (path , err )
1094
1094
character (len=* ), intent (in ) :: path
1095
- type (state_type), intent (out ) :: err
1095
+ type (state_type), optional , intent (out ) :: err
1096
1096
type (state_type) :: err0
1097
1097
1098
1098
interface
@@ -1107,7 +1107,7 @@ end function stdlib_set_cwd
1107
1107
code = stdlib_set_cwd(to_c_char(trim (path)))
1108
1108
1109
1109
if (code /= 0 ) then
1110
- err0 = state_type(STDLIB_FS_ERROR, " code: " , to_string(code) // " , " , c_get_strerror())
1110
+ err0 = FS_ERROR_CODE( code, c_get_strerror())
1111
1111
call err0% handle(err)
1112
1112
end if
1113
1113
end subroutine set_cwd
0 commit comments