Skip to content

Add RealPath module#65

Open
rnjtranjan wants to merge 1 commit intomasterfrom
RealPath_module
Open

Add RealPath module#65
rnjtranjan wants to merge 1 commit intomasterfrom
RealPath_module

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