Live data from Hacker News

Untitled topic

news.ycombinator.com

1–8 of 8 posts

Re: undefined

#5
To get runtime case-sensitivity problems with filenames I guess you must be doing something like having resource files as part of your project and then loading them from disk at runtime, but the code that loads them is being told the slightly wrong filename. Depending on why you need to load those files, there's not much you can do about that except stop coding the wrong filenames!

There are things that can help with filesystem differences though, if you're not using them already look under the System.IO namespace

Path.Combine will combine path segments using the native directory separator either `/` or `\`.

Path.GetTempFileName will create a temporary file on disk so you don't need to know if that's `/tmp` or `C:\whereverwindowsputsit\`

Mostly everything just works when coding on Windows and deploying to Linux, I think it is only the filesystem differences that ever cause problems and even then it's down to coding mistakes.

Re: undefined

#6

To get runtime case-sensitivity problems with filenames I guess you must be doing something like having resource files as part of your project and then loading them from disk at runtime, but the code that loads them is being told the slightly wrong filename. Depending on why you need to load those files, there's not much you can do about that except stop coding the wrong filenames! There are things that can help with…

[flagged]

Re: undefined

#8

To get runtime case-sensitivity problems with filenames I guess you must be doing something like having resource files as part of your project and then loading them from disk at runtime, but the code that loads them is being told the slightly wrong filename. Depending on why you need to load those files, there's not much you can do about that except stop coding the wrong filenames! There are things that can help with…

[flagged]

I guess watch out for different line endings in files "\r\n" in Windows, "\n" in Linux. The best thing to do there if possible is use tools in Windows that preserve Linux line endings so you never see "\r\n" in Linux at runtime.

If you're using classes under the System.Drawing namespace then a lot of functionality is missing in Linux, but I don't know much about that. The 3rd party ImageSharp library fills some of the gap and is just generally awesome.

Other than that, I'm sure there's niche things but nothing is coming to mind!