Manual Reference Pages  - system_ischr (3m_system)

NAME

system_ischr(3f) - [M_system:QUERY_FILE] checks if argument is a character device (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Return Value
Errors
See Also
Examples

SYNOPSIS

elemental impure logical function system_ischr(pathname)

     character(len=*),intent(in) :: pathname
     logical                     :: system_ischr

DESCRIPTION

The ischr(3f) function checks if path is a path to a character device.

OPTIONS

path a character string representing a character device pathname. Trailing spaces are ignored.

RETURN VALUE

The system_ischr() function should always be successful and no return value is reserved to indicate an error.

ERRORS

No errors are defined.

SEE ALSO

system_isreg(3f), system_stat(3f), system_isdir(3f), system_perm(3f)

EXAMPLES

check if filename is a character file

   program demo_system_ischr
   use M_system, only : system_ischr
   implicit none
   integer                     :: i
   character(len=80),parameter :: names(*)=[ &
   ’/dev/tty        ’, &
   ’/dev/null       ’, &
   ’/dev/console    ’, &
   ’/dev/random     ’, &
   ’/dev/urandom    ’, &
   ’/dev/zero       ’, &
   ’/tmp            ’, &
   ’/tmp/NOTTHERE   ’, &
   ’/usr/local      ’, &
   ’.               ’, &
   ’char_dev.test   ’, &
   ’PROBABLY_NOT    ’]
   do i=1,size(names)
      write(*,*)’ is ’,                   &
               & trim(names(i)),          &
               & ’ a character device? ’, &
               & system_ischr(names(i))
   enddo
   end program demo_system_ischr

Results:

 >   is /dev/tty a character device?  T
 >   is /dev/null a character device?  T
 >   is /dev/console a character device?  T
 >   is /dev/random a character device?  T
 >   is /dev/urandom a character device?  T
 >   is /dev/zero a character device?  T
 >   is /tmp a character device?  F
 >   is /tmp/NOTTHERE a character device?  F
 >   is /usr/local a character device?  F
 >   is . a character device?  F
 >   is char_dev.test a character device?  F
 >   is PROBABLY_NOT a character device?  F


Nemo Release 3.1 system_ischr (3m_system) March 07, 2025
Generated by manServer 1.08 from cad56242-c68e-43db-ab9c-1c5d2bd73035 using man macros.