-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to get file/folder properties #57
Comments
|
Sorry, I was being way to vague and general. For my current project I really only need a function that gets the mime type of a file (i.e. image/jpeg) and a function that checks if a filepath is a directory:
|
Since MIME types are not stored as part of the files themselves, there is no accurate way to determine the MIME type without applying a tedious set of heuristic algorithms on the contents of the files. Unfortunately, this means it does not lie within the scope of
|
So I went ahead and implemented the following:
I was originally going to implement One could then implement isDirectory :: FilePath -> IO Bool
isDirectory path = do
exists <- doesPathExist path
if exists
then doesDirectoryExist path
else ioError (mkIOError doesNotExistErrorType "isDirectory" Nothing (Just path)) |
Is it possible to add a function like:
Thank you!
The text was updated successfully, but these errors were encountered: