FileName is an abstract type intended to facilitate the input and output of unicode filenames.
- data FileName
- fp2fn :: FilePath -> FileName
- fn2fp :: FileName -> FilePath
- fn2ps :: FileName -> ByteString
- ps2fn :: ByteString -> FileName
- niceps2fn :: ByteString -> FileName
- fn2niceps :: FileName -> ByteString
- break_on_dir :: FileName -> Maybe (FileName, FileName)
- norm_path :: FileName -> FileName
- own_name :: FileName -> FileName
- superName :: FileName -> FileName
- movedirfilename :: FileName -> FileName -> FileName -> FileName
- encode_white :: FilePath -> String
- decode_white :: String -> FilePath
- (///) :: FileName -> FileName -> FileName
- breakup :: String -> [String]
Documentation
fn2ps :: FileName -> ByteStringSource
ps2fn :: ByteString -> FileNameSource
encode_white :: FilePath -> StringSource
encode_white
translates whitespace in filenames to a darcs-specific
format (backslash followed by numerical representation according to ord
).
Note that backslashes are also escaped since they are used in the encoding.
encode_white "hello there" == "hello\32there" encode_white "hello\there" == "hello\\there"
decode_white :: String -> FilePathSource
decode_white
interprets the Darcs-specific "encoded" filenames
produced by encode_white
decode_white "hello\32there" == "hello there" decode_white "hello\\there" == "hello\there" decode_white "hello\there" == error "malformed filename"