Hacker News new | past | comments | ask | show | jobs | submit login

Only in some special cases, not in general.



Really? I use forward slashes all the time in windows 10. I don't think I've run into a problem yet.


Yes. One huge problem is slashes are also used for command-line switches. That can entirely change the meaning of your commands.

For example, compare these two in the command prompt:

  start /Windows/Notepad.exe
  start \Windows\Notepad.exe
I wouldn't blame this on poor parsing or other silly things though. I actually think it makes sense to use slashes for switches, because they are invalid filename characters, whereas dashes are valid, and hence get ambiguous (hence the need for "--" in *nix). I think it would've made more sense to disallow slashes as directory separators entirely, to avoid this for good.


They work everywhere, except on the command line or file dialogue windows.


On the contrary. It accepts '/' as a path separator for filenames in every API call. The special case that doesn't is command line parsing (cmd.exe and a few others)


> On the contrary. It accepts '/' as a path separator for filenames in every API call. The special case that doesn't is command line parsing (cmd.exe and a few others)

No...

  assert( PathIsRoot(TEXT("C:\\")));
  assert(!PathIsRoot(TEXT("C:/" )));
Also, I believe you meant directory separator, not path separator.

Please don't be so tempted to take an antagonistic position and confidently declare other people wrong when you cannot possibly support your position in full... I see this very commonly on HN and I cannot tell you how extremely frustrating it is for those trying to help. It sucks away all the energy and enthusiasm we have for trying to help people get accurate information (meaning we might not even have the energy to bother to respond), and on top of that, you risk disseminating incorrect information. In this case, you simply could not have tried all the wide variety of Windows APIs, so at the very least, maybe say "in my experience" if something is only based on your experience.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: