talira

filepath

Cross-platform file path manipulation for Haskell

open sourceBSD-3-Clausefree

filepath is the Haskell library for manipulating file paths in a cross-platform way: splitting and joining paths, extensions, directories and drives, with the rules for POSIX and Windows paths. It ships with Haskell's GHC and offers two interfaces: the legacy FilePath (a String) and the recommended OsPath, an operating-system-encoded ShortByteString that handles paths correctly. Its companion directory uses it for filesystem operations.

Problems it solves

  • join and split file paths portably in Haskell code
  • change a file's extension or get its directory name in Haskell
  • handle file paths with non-UTF-8 names correctly in Haskell

Features

  • Split, join and normalise paths
  • Extension and directory helpers
  • POSIX and Windows path rules
  • OsPath type with platform-native encoding
  • Ships with GHC

Alternatives

The same job

These do what filepath does.

  1. fsnotify (Haskell) Cross-platform file change notifications for Haskell
  2. directory Platform-agnostic library for filesystem operations in Haskell
  3. path-io Filesystem operations for Haskell's typed path library

Compare filepath with the top 3