ocaml-crunch uses Filename.concat which uses Filename.dir_sep, so suppose that I have css/style.css, on Linux I can retrieve it from the crunch-generated module with "css/style.css" or "/css/style.css", but on Windows it's "css\\style.css" or "/css\\style.css" which is slightly inconsistent (this line). Should it always use Filename.dir_sep (to have "\\css\\style.css" for the second option) or always forward slashes?
My use-case is that I was bundling static assets in my executable which contains a web server. Urls such as http://localhost/css/style.css return 404 on Windows when simply forwarded to crunch because of the string comparison failure. If we go with the OS native file separators, this would require to possibly rewrite the url path to accommodate crunch view of the world.
ocaml-crunch uses
Filename.concat
which usesFilename.dir_sep
, so suppose that I havecss/style.css
, on Linux I can retrieve it from the crunch-generated module with"css/style.css"
or"/css/style.css"
, but on Windows it's"css\\style.css"
or"/css\\style.css"
which is slightly inconsistent (this line). Should it always useFilename.dir_sep
(to have"\\css\\style.css"
for the second option) or always forward slashes?My use-case is that I was bundling static assets in my executable which contains a web server. Urls such as
http://localhost/css/style.css
return 404 on Windows when simply forwarded to crunch because of the string comparison failure. If we go with the OS native file separators, this would require to possibly rewrite the url path to accommodate crunch view of the world.