query
On this page

readFileType

builtins.readFileType

Primop
Docs pulled from | This Revision | about 2 hours 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"
This function is not defined in a .nix file. It is likely a builtins function or an alias of a builtins function. builtins functions are predefined functions provided by Nix.
(lib.filesystem.pathType)

Noogle detected

Aliases

Implementation

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