summaryrefslogtreecommitdiff
path: root/testsuite/tests/module/T1074a.hs
blob: 1fb6f7108c0ff10c06d82395772078e8db3458eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{-# OPTIONS_GHC -fwarn-unused-imports #-}

module Test where

import qualified System.FilePath as FilePath.Native
         ( joinPath )
import qualified System.FilePath.Posix as FilePath.Posix
         ( joinPath, splitDirectories )
import qualified System.FilePath.Windows as FilePath.Windows
         ( joinPath )

data TarPath = TarPath FilePath -- path name, 100 characters max.
                       FilePath -- path prefix, 155 characters max.

fromTarPath, fromTarPathToPosixPath
           , fromTarPathToWindowsPath :: TarPath -> FilePath

fromTarPath (TarPath name prefix) =
  FilePath.Native.joinPath $ FilePath.Posix.splitDirectories prefix
                          ++ FilePath.Posix.splitDirectories name

fromTarPathToPosixPath (TarPath name prefix) =
  FilePath.Posix.joinPath $ FilePath.Posix.splitDirectories prefix
                         ++ FilePath.Posix.splitDirectories name

fromTarPathToWindowsPath (TarPath name prefix) =
  FilePath.Windows.joinPath $ FilePath.Posix.splitDirectories prefix
                           ++ FilePath.Posix.splitDirectories name