Skip to content
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 RealPath module #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add RealPath module #65

wants to merge 1 commit into from

Conversation

rnjtranjan
Copy link
Contributor

No description provided.

-- and remove as many indirections from it as possible.

realPath :: FilePath -> IO FilePath
realPath = canonicalizePath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the same. Did you test and compare the realpath coreutil and this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes:
*Streamly.Coreutils.RealPath> realPath "./test2.txt"
"/home/ranjeetr/composewell/CoreUtils/streamly-coreutils/test2.txt"
*Streamly.Coreutils.RealPath> realPath "../test2.txt"
"/home/ranjeetr/composewell/CoreUtils/test2.txt"
*Streamly.Coreutils.RealPath>

kaveri:/composewell/CoreUtils/streamly-coreutils  (monadic-predicates)$ (nix) realpath ./test2.txt
/home/ranjeetr/composewell/CoreUtils/streamly-coreutils/test2.txt
kaveri:
/composewell/CoreUtils/streamly-coreutils  (monadic-predicates)$ (nix) realpath ../test2.txt
/home/ranjeetr/composewell/CoreUtils/test2.txt
kaveri:~/composewell/CoreUtils/streamly-coreutils  (RealPath_module)$ (nix)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same behaviors for symlink and nonexistent files.
*Streamly.Coreutils.RealPath> realPath "./ls.txt"
"/home/ranjeetr/composewell/CoreUtils/streamly-coreutils/test2.txt"
*Streamly.Coreutils.RealPath> realPath "../lsssss.txt"
"/home/ranjeetr/composewell/CoreUtils/lsssss.txt

@harendra-kumar
Copy link
Member

Try testing on a symlink and on non-existing files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants