C Library Functions  - system_getcwd (3)

NAME

system_getcwd(3f) - [M_system:QUERY_FILE] call getcwd(3c) to get the pathname of the current working directory (LICENSE:PD)

CONTENTS

Synopsis
Description
Return Value
Example
Author
License

SYNOPSIS

subroutine system_getcwd(output,ierr)

       character(len=:),allocatable,intent(out) :: output
       integer,intent(out)                      :: ierr

DESCRIPTION

system_getcwd(3f) calls the C routine getcwd(3c) to obtain the absolute pathname of the current working directory.

RETURN VALUE

OUTPUT The absolute pathname of the current working directory The pathname shall contain no components that are dot or dot-dot, or are symbolic links.
IERR is not zero if an error occurs.

EXAMPLE

Sample program:

     program demo_system_getcwd
     use M_system, only : system_getcwd
     implicit none
     character(len=:),allocatable :: dirname
     integer                      :: ierr
     call system_getcwd(dirname,ierr)
     if(ierr.eq.0)then
        write(*,*)’CURRENT DIRECTORY ’,trim(dirname)
     else
        write(*,*)’ERROR OBTAINING CURRENT DIRECTORY NAME’
     endif
     end program demo_system_getcwd

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 system_getcwd (3) July 22, 2023
Generated by manServer 1.08 from ba0d5f7c-ba2a-4fd3-bcfe-bcfd6ac46292 using man macros.