system_getcwd(3f) - [M_system:QUERY_FILE] call getcwd(3c) to get the pathname of the current working directory (LICENSE:PD)
Synopsis
Description
Return Value
Examples
Author
License
subroutine system_getcwd(output,ierr)
character(len=:),allocatable,intent(out) :: output integer,intent(out) :: ierr
system_getcwd(3f) calls the C routine getcwd(3c) to obtain the absolute pathname of the current working directory.
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.
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
John S. Urban
Public Domain
Nemo Release 3.1 | system_getcwd (3m_system) | March 07, 2025 |