C Library Functions  - is_hidden_file (3)

NAME

is_hidden_file(3f) - [M_io:QUERY] determine if a pathname points to a hidden file, which is defined as a file basename starting with a period. (LICENSE:PD)

CONTENTS

Syntax
Description
Limitations
Options
Returns
Example
See Also
Author
License

SYNTAX

impure elemental function is_hidden_file(PATH) result(YESNO)

     character(len=*),intent(in) :: PATH
     logical                     :: YESNO

DESCRIPTION

Given a pathname determine if it is a hidden file. This is simply assumed to be a basename that does not begin with a period and is not a single or double period, assumed to represent the current directory and parent directory.

LIMITATIONS

Pathnames are not expanded to a canonical form, so if the basename is value will still be .FALSE. . Filenames are assumed to not contain leading or trailing spaces.

OPTIONS

PATH pathname to classify. It need not exist.

RETURNS

YESNO true if pathname points to a hidden file, otherwise it is false.

EXAMPLE

Sample program:

      program demo_is_hidden_file
      use M_io, only : is_hidden_file, basename
         call showit(’.abc’)
         call showit(’./.’)
         call showit(’..’)
         call showit(’...’)
         call showit(’/abc/def/notes.txt’)
         call showit(’/abc/def/.hide’)
      contains
      subroutine showit(path)
      character(len=*),intent(in) :: path
         write(*,*)is_hidden_file(path), &
          & ’ ,path=’,path
      end subroutine showit
      end program demo_is_hidden_file

Results:

    >  T  ,path=.abc
    >  F  ,path=./.
    >  F  ,path=..
    >  T  ,path=...
    >  F  ,path=/abc/def/notes.txt
    >  T  ,path=/abc/def/.hide

SEE ALSO

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 is_hidden_file (3) July 22, 2023
Generated by manServer 1.08 from 5819071c-0f7a-4da2-8bf3-3636821e51d7 using man macros.