-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
expandFilename works only on existing files and directories. #6486
Comments
So unless there is a use case for this I think it's fine to just document this behaviour. |
Expanding file names is very common for logging (you don't want to log out a relative path). A typical use case is to log out that you are going to create a file before doing so. |
I think one reason it work like that is symlinks (assuming this function also resolves them). You cannot expand the filename without knowing whether some intermediate part is a symlink, and for that you have to touch the filesystem and work on existing paths. If instead this is a pure function with no reference to the filesystem, it makes sense that it works at an abstract level without requiring files to exist |
I think it's fine. proc expandFilename*(filename: string): string {.rtl, extern: "nos$1",
tags: [ReadDirEffect], noNimScript.} =
## Returns the full (`absolute`:idx:) path of an existing file `filename`.
##
## Raises `OSError` in case of an error. Follows symlinks. |
Also, the documentation does not mention this behavior.
The text was updated successfully, but these errors were encountered: