query
On this page

pathType

lib.sources.pathType

Primop
Docs pulled from | This Revision | 14 minutes ago

Takes 1 arguments

p


The type of a path. The path needs to exist and be accessible. The result is either "directory" for a directory, "regular" for a regular file, "symlink" for a symlink, or "unknown" for anything else.

Inputs

path

The path to query

Type

pathType :: Path -> String

Examples

lib.filesystem.pathType usage example

pathType /.
=> "directory"

pathType /some/file.nix
=> "regular"
(lib.filesystem.pathType)

Noogle detected

Aliases

Implementation

This function is implemented in c++ and is part of the native nix runtime.