DOS/Windows and slashes (was Re: Windows XP Pro and Possible
filePro Bug)
Fairlight
fairlite at fairlite.com
Sat Dec 4 18:54:22 PST 2004
At Sat, Dec 04, 2004 at 07:35:54PM -0500 or thereabouts,
suspect Bill Vermillion was observed uttering:
> And one reason that MS used the "\" for pathnames was that
> in their languages you had a choice of two switches, "/" or "-",
> when specifiying command line options.
>
> I remember when I was learning to use random access fixed length
> records and having to specify two or three options on the file
> names given. You could use /nnn or -nnn in their BASIC
> interpreter, and I vaguely recall the same thing in their Fortran.
Unfortunately, people have gotten too used to /switch arguments, and expect
things to be "/?" for help instead of "-h" or "--help". I had a Windows
user request that I add "/?" as an argument for help for one of my
packages. Getopt doesn't like that though, so I have to cycle through the
argv array and make sure none of them are that particular string. It's
useless on *nix as an option, unless you escape it or set noglob. But
Windows users insist it should be there.
How annoying a convention. Another instance of Not Invented Here. :(
I don't mind porting to MS in a functional sense. Being asked to emulate
a poor design decision that became a defacto convention is something that
will rankle me a little, but I did it anyway. If that's what they want,
that's what they get. It's just one of those "gotchas" to keep in mind
when porting.
I've seen it go the other way--someone had a Windows package that was being
ported to linux, and all the argument options started with / and you'd put
in a pathname to a file and it would want to say it was an illegal option
rather than taking it as part of the path. They fixed theirs as well, but
it's annoying that not everyone has adopted the relatively sane - and --
getopt switch standards.
mark->
More information about the Filepro-list
mailing list