printDetailList p (x:xs) = do
    let path = (p ++ "/" ++ x)
    status <- getFileStatus path
    let mode = fileMode status
    putChar $ getFileType status
    putChar (if ownerReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if ownerWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if ownerExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar (if groupReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if groupWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if groupExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar (if otherReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if otherWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if otherExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar ' '
    putStr $ padString 2 $ show $ linkCount status
    putChar ' '
    putStr $ padString 8 $ show $ fileOwner status
    putChar ' '
    putStr $ padString 8 $ show $ fileGroup status
    putChar ' '
    putStr $ padString 10 $ show $ fileSize status
    putChar ' '
    let time = posixSecondsToUTCTime.fromIntegral.fromEnum $ modificationTime status
    putStr $ formatTime defaultTimeLocale "%h %d %H:%M" time
    putChar ' '
    putStrLn x
    printDetailList p xs
printDetailList p (x:xs) = do
    let path = (p ++ "/" ++ x)
    status <- getFileStatus path
    let mode = fileMode status
    putChar $ getFileType status
    putChar (if ownerReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if ownerWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if ownerExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar (if groupReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if groupWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if groupExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar (if otherReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if otherWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if otherExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar ' '
    putStr $ padString 2 $ show $ linkCount status
    putChar ' '
    putStr $ padString 8 $ show $ fileOwner status
    putChar ' '
    putStr $ padString 8 $ show $ fileGroup status
    putChar ' '
    putStr $ padString 10 $ show $ fileSize status
    putChar ' '
    let time = posixSecondsToUTCTime.fromIntegral.fromEnum $ modificationTime status
    putStr $ formatTime defaultTimeLocale "%h %d %H:%M" time
    putChar ' '
    putStrLn x
    printDetailList p xs
printDetailList p (x:xs) = do
    let path = (p ++ "/" ++ x)
    status <- getFileStatus path
    let mode = fileMode status
    putChar $ getFileType status
    putChar (if ownerReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if ownerWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if ownerExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar (if groupReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if groupWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if groupExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar (if otherReadMode .&. mode == 0 then 'r' else '-') 
    putChar (if otherWriteMode .&. mode == 0 then 'w' else '-') 
    putChar (if otherExecuteMode .&. mode == 0 then 'x' else '-') 
    putChar ' '
    putStr $ padString 2 $ show $ linkCount status
    putChar ' '
    putStr $ padString 8 $ show $ fileOwner status
    putChar ' '
    putStr $ padString 8 $ show $ fileGroup status
    putChar ' '
    putStr $ padString 10 $ show $ fileSize status
    putChar ' '
    let time = posixSecondsToUTCTime.fromIntegral.fromEnum $ modificationTime status
    putStr $ formatTime defaultTimeLocale "%h %d %H:%M" time
    putChar ' '
    putStrLn x
    printDetailList p xs