Product Site

5.4.8.24. isHidden

Returns .true if the absolute path of the target File object references an existing file or directory which is hidden. Otherwise returns .false.

On Windows, a file or directory is hidden when its attribute FILE_ATTRIBUTE_HIDDEN is set.

On Unix-like systems, a file or directory is hidden when its name starts with a period character (".") or when one of its parent directories has a name starting with a period character.
Example 5.255. File class — isHidden method
/* Unix-like system, when file exists */
say .File~new("/tmp/file")~isHidden             -- 0
say .File~new("/tmp/.file")~isHidden            -- 1
say .File~new("/tmp/.dir/file")~isHidden        -- 1