Manual Reference Pages  - system_getcwd (3m_system)

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
Examples
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.

EXAMPLES

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 (3m_system) March 07, 2025
Generated by manServer 1.08 from e01737ad-3cd4-4728-8dc4-e1e072bb068a using man macros.