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)
Syntax
Description
Limitations
Options
Returns
Examples
See Also
Author
License
impure elemental function is_hidden_file(PATH) result(YESNO)
character(len=*),intent(in) :: PATH logical :: YESNO
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.
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.
PATH pathname to classify. It need not exist.
YESNO true if pathname points to a hidden file, otherwise it is false.
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_fileResults:
> T ,path=.abc > F ,path=./. > F ,path=.. > T ,path=... > F ,path=/abc/def/notes.txt > T ,path=/abc/def/.hide
John S. Urban
Public Domain
Nemo Release 3.1 | is_hidden_file (3) | February 23, 2025 |