filepath: Library for manipulating FilePaths in a cross platform way.
This package provides functionality for manipulating FilePath values, and is shipped with GHC. It provides two variants for filepaths:
legacy filepaths:
type FilePath = Stringoperating system abstracted filepaths (
OsPath): internally unpinnedShortByteString(platform-dependent encoding)
It is recommended to use OsPath when possible, because it is more correct.
For each variant there are three main modules:
System.FilePath.Posix / System.OsPath.Posix manipulates POSIX/Linux style
FilePathvalues (with/as the path separator).System.FilePath.Windows / System.OsPath.Windows manipulates Windows style
FilePathvalues (with either\or/as the path separator, and deals with drives).System.FilePath / System.OsPath for dealing with current platform-specific filepaths
For more powerful string manipulation of OsPath, you can use the os-string package (OsPath is a type synonym for OsString).
An introduction into the new API can be found in this blog post. Code examples for the new API can be found here.
[Skip to Readme]
Modules
[Index] [Quick Jump]
Flags
Manual Flags
| Name | Description | Default |
|---|---|---|
| cpphs | Use cpphs (fixes haddock source links) | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- filepath-1.5.5.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 1.0, 1.1.0.0, 1.1.0.1, 1.1.0.2, 1.1.0.3, 1.1.0.4, 1.2.0.0, 1.2.0.1, 1.3.0.0, 1.3.0.1, 1.3.0.2, 1.4.0.0, 1.4.1.0, 1.4.1.1, 1.4.1.2, 1.4.2, 1.4.2.1, 1.4.2.2, 1.4.100.0, 1.4.100.1, 1.4.100.2, 1.4.100.3, 1.4.100.4, 1.4.101.0, 1.4.102.0, 1.4.200.0, 1.4.200.1, 1.4.300.1, 1.4.300.2, 1.4.301.0, 1.5.0.0, 1.5.2.0, 1.5.3.0, 1.5.4.0, 1.5.5.0 (info) |
|---|---|
| Change log | changelog.md |
| Dependencies | base (>=4.12.0.0 && <4.23), bytestring (>=0.11.3.0), deepseq, exceptions, os-string (>=2.0.1), template-haskell, template-haskell-lift (>=0.1 && <0.2), template-haskell-quasiquoter (>=0.1 && <0.2) [details] |
| Tested with | ghc ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1 |
| License | BSD-3-Clause |
| Copyright | Neil Mitchell 2005-2020, Julian Ospald 2021-2022 |
| Author | Neil Mitchell <ndmitchell@gmail.com> |
| Maintainer | Julian Ospald <hasufell@posteo.de> |
| Uploaded | by maerwald at 2026-01-20T08:14:45Z |
| Category | System |
| Home page | https://github.com/haskell/filepath/blob/master/README.md |
| Bug tracker | https://github.com/haskell/filepath/issues |
| Source repo | head: git clone https://github.com/haskell/filepath |
| Distributions | Arch:1.4.300.1, Fedora:1.4.301.0 |
| Reverse Dependencies | 1845 direct, 13843 indirect [details] |
| Downloads | 69807 total (137 in the last 30 days) |
| Rating | 2.25 (votes: 2) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2026-01-20 [all 1 reports] |