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

Unable to read symbolic link in debug mode #234

Closed
Buckram123 opened this issue Feb 22, 2024 · 4 comments · Fixed by #235
Closed

Unable to read symbolic link in debug mode #234

Buckram123 opened this issue Feb 22, 2024 · 4 comments · Fixed by #235

Comments

@Buckram123
Copy link
Contributor

Buckram123 commented Feb 22, 2024

RustEmbed::get fails to get a symbolic link file in debug mode, but suceeds in "release" see #235 for example

@pyrossh
Copy link
Owner

pyrossh commented Feb 22, 2024

@Buckram123 Thanks for reporting this. Would you be interested in a PR for this fix? It seems to me we read the file directly here https://github.com/pyrossh/rust-embed/blob/master/utils/src/lib.rs#L136
What we need to do is read the file metadata and check if its a sym_link and if it is we need to use the fs::read_link fn to get the path to the actual file.

@pyrossh
Copy link
Owner

pyrossh commented Feb 22, 2024

This fn seems to be a better option, std::fs::canonicalize

@Buckram123
Copy link
Contributor Author

@Buckram123 Thanks for reporting this. Would you be interested in a PR for this fix? It seems to me we read the file directly here https://github.com/pyrossh/rust-embed/blob/master/utils/src/lib.rs#L136 What we need to do is read the file metadata and check if its a sym_link and if it is we need to use the fs::read_link fn to get the path to the actual file.

Hey, thanks for a quick reply! Sure, would be cool to contribute here. I'll try to fix it on saturday 🚀

@pyrossh
Copy link
Owner

pyrossh commented Feb 26, 2024

Fixed in v8.3.0

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 a pull request may close this issue.

2 participants