system_getpwuid(3f) - [M_system:QUERY] get login name associated with a UID (LICENSE:PD)
Synopsis
Description
Option
Return Value
Examples
Author
License
function system_getpwuid(uid) result (uname)
class(*),intent(in) :: uid ! any INTEGER type character(len=:),allocatable :: uname
The system_getpwuid() function returns a string containing the user name associated with the given UID. If no match is found it returns a null string and sets errno to indicate the error.
uid UID to try to look up associated username for. Can be of any INTEGER type.
uname returns the login name.
Sample program:
program demo_system_getpwuid use M_system, only : system_getpwuid use M_system, only : system_getuid use,intrinsic :: iso_fortran_env, only : int64 implicit none character(len=:),allocatable :: name integer(kind=int64) :: uid uid=system_getuid() name=system_getpwuid(uid) write(*,("login[",a,"] has UID ",i0))name,uid end program demo_system_getpwuid
John S. Urban
Public Domain
Nemo Release 3.1 | system_getpwuid (3m_system) | March 07, 2025 |