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

Edge case: embed NTFS File Streams #139

Closed
NfNitLoop opened this issue Jun 24, 2021 · 3 comments
Closed

Edge case: embed NTFS File Streams #139

NfNitLoop opened this issue Jun 24, 2021 · 3 comments

Comments

@NfNitLoop
Copy link
Contributor

NfNitLoop commented Jun 24, 2021

OK, I really don't expect rust-embed to implement this, and it's probably not a good idea, but it would make my life easier way out on this edge case. :)

Here's the bug I'm running into: NfNitLoop/feoblog#16 (which is not rust-embed's fault!)

In short: Something is generating file paths that have : in them. On Windows, this ends up creating a thing called an NTFS alternate data stream. So for example, the file:

C:\foo\bar:baz

Is actually a zero-byte file called C:\foo\bar, which has an alternate data stream associated with it called baz. This all sort of works in development mode in rust-embed. If I ask rust-embed for a file called "bar:baz", it (seems that it?) asks NTFS to open that file path, and it serves the data as expected.

BUT, when I build for production, bar is included as a 0-byte file, but :baz is not. This is unsurprising. It's not a file. It's an additional "stream".

Please feel free to close. I mostly just wanted to communicate a weird/unexpected edge case on Windows. :)

@NfNitLoop
Copy link
Contributor Author

this is unsurprising

Well, it's unsurprising now, now that I know what's going on. I should say -- it was very surprising when it happened to me. I didn't know about NTFS data streams. I didn't know why things worked in dev. mode and not production mode. At first I thought it was a rust-embed bug.

@NfNitLoop
Copy link
Contributor Author

If you're interested, I could try adding a feature flag for including NTFS data streams, just to see how that works. 😅

@AzureMarker
Copy link
Collaborator

That is a weird edge case. Either way, I'm not sure how rust-embed could support embedding NTFS streams in the binary, so I'll close this. Technically would could probably detect the case (if platform is windows and path contains a colon) but it's probably not that worthwhile. Thanks for noting it, as I'm sure someone in the future may run into a similar issue.

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

No branches or pull requests

2 participants