Product SiteDocumentation Site

5.4.25.18. isHidden


>>-isHidden----------------------------------------------------><

Returns .true ("1") if the absolute path of the target File object references an existing file or directory which is hidden. Otherwise returns .false ("0").
On Windows, a file or directory is hidden when its attribute FILE_ATTRIBUTE_HIDDEN is set.
On Unix, 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.208. Class FILE - isHidden method


/* Unix, 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