listAllFiles :: DirStream -> Int -> IO [String]
listAllFiles s f = do
    file <- readDirStream s
    if (file == "") 
        then return []
        else do
            list <- listAllFiles s f
            if (file !! 0 /= '.' || f .&. 1 /= 0)
                then return $ file:list
                else return list
listAllFiles :: DirStream -> Int -> IO [String]
listAllFiles s f = do
    file <- readDirStream s
    if (file == "") 
        then return []
        else do
            list <- listAllFiles s f
            if (file !! 0 /= '.' || f .&. 1 /= 0)
                then return $ file:list
                else return list
listAllFiles s f = do
    file <- readDirStream s
    if (file == "") 
        then return []
        else do
            list <- listAllFiles s f
            if (file !! 0 /= '.' || f .&. 1 /= 0)
                then return $ file:list
                else return list