A little idiom I like

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

To wit:

irb(main):001:0> require 'Win32API'
=> true
irb(main):002:0> PathIsRoot = Win32API.new('shlwapi', 'PathIsRoot', 'P',
'I')
=> #<Win32API:0x2c17be8>
irb(main):003:0> PathIsRoot.call("C:\\")
=> 1
irb(main):004:0> PathIsRoot.call("C:/")
=> 0

Regards,

Dan

This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.

···

-----Original Message-----
From: Austin Ziegler [mailto:halostatue@gmail.com]
Sent: Wednesday, September 06, 2006 11:15 AM
To: ruby-talk ML
Subject: Re: A little idiom I like

On 9/4/06, Hal Fulton <hal9000@hypermetrics.com> wrote:
> Rick DeNatale wrote:
>> No easily, even if you can figure out how to define a
method named \
>> or "\\" it's going to be messy sending it.
> If we're seriously talking about a Windows usage, let me point out
> that it's only on the command line that \ is needed.

Mostly.

> Internally, WIndows paths can use ordinary slashes (in
every case I'm
> familiar with).

Mostly.

The reality of the matter is that with the APIs that Ruby is
currently using -- which are problematic for certain cases
(Unicode) -- the \ and / are interchangeable internally.

The advanced APIs -- the Unicode ones and the ones that make
it possible to have very long path names -- requires \.

-austin

If only Gary Kildall had not decided to use / instead of - for
parameter markers in CP/M, so that it wasn't taken when directories
were added. I'm pretty sure that he's the one to blame, or did it come
from one of the DEC operating systems he used as a model for the
'shell?'

···

On 9/6/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Inasmuch as is possible, where Ruby provides these, it should hide
this distinction. I would hate to have to enter \\ every time I wanted
to put two files together. (It would also increase the mismatch
between Ruby Windows and everywhere else, so the more we can hide that
the more portable we make Ruby.)

-austin

···

On 9/6/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

--
Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/
               * austin@halostatue.ca * http://www.halostatue.ca/feed/
               * austin@zieglers.ca

Rick DeNatale wrote:

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

If only Gary Kildall had not decided to use / instead of - for
parameter markers in CP/M, so that it wasn't taken when directories
were added. I'm pretty sure that he's the one to blame, or did it come
from one of the DEC operating systems he used as a model for the
'shell?'

Interesting question. I always assumed the /x notation
came to DOS by way of CP/M, but now I recall that it
was also in TOPS10.

And yes, that was a looong time ago. My keychain has
2000 times as much memory as the college mainframe
had then.

Hal

···

On 9/6/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

Don't think it was DEC. On PDP-11/RSX and VAX/VMS directories were enclosed in square brackets, something like SY:[0,1] or DUA0:[SYS$ROOT.DIR.SUBDIR], always with unique [ ] delimiters.

Best,
Mike Dvorkin
http://www.rubywizards.com

···

On Sep 6, 2006, at 2:16 PM, Rick DeNatale wrote:

On 9/6/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

If only Gary Kildall had not decided to use / instead of - for
parameter markers in CP/M, so that it wasn't taken when directories
were added. I'm pretty sure that he's the one to blame, or did it come
from one of the DEC operating systems he used as a model for the
'shell?'

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Hal Fulton wrote:

Rick DeNatale wrote:

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

If only Gary Kildall had not decided to use / instead of - for
parameter markers in CP/M, so that it wasn't taken when directories
were added. I'm pretty sure that he's the one to blame, or did it come
from one of the DEC operating systems he used as a model for the
'shell?'

Interesting question. I always assumed the /x notation
came to DOS by way of CP/M, but now I recall that it
was also in TOPS10.

And yes, that was a looong time ago. My keychain has
2000 times as much memory as the college mainframe
had then.

Hal

And VMS and RSX-11. My recollection is that CP-M command line syntax in
fact descends from RSX-11 and/or RT-11, so it's not surprising.

···

On 9/6/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

Mike Dvorkin wrote:

Don't think it was DEC. On PDP-11/RSX and VAX/VMS directories were enclosed in square brackets, something like SY:[0,1] or DUA0:[SYS $ROOT.DIR.SUBDIR], always with unique [ ] delimiters.

Yes, the brackets were used that way... but Rick was talking
about the use of slashes for switches (the way Unix uses the
hyphen). That's a DECism, though it may have come from
elsewhere -- as in KJOB /F or simply K/F

Hal

···

Best,
Mike Dvorkin
http://www.rubywizards.com

On Sep 6, 2006, at 2:16 PM, Rick DeNatale wrote:

On 9/6/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

If only Gary Kildall had not decided to use / instead of - for
parameter markers in CP/M, so that it wasn't taken when directories
were added. I'm pretty sure that he's the one to blame, or did it come
from one of the DEC operating systems he used as a model for the
'shell?'

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Mike Dvorkin wrote:

Don't think it was DEC. On PDP-11/RSX and VAX/VMS directories were
enclosed in square brackets, something like SY:[0,1] or
DUA0:[SYS$ROOT.DIR.SUBDIR], always with unique [ ] delimiters.

Best,
Mike Dvorkin
http://www.rubywizards.com

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

If only Gary Kildall had not decided to use / instead of - for
parameter markers in CP/M, so that it wasn't taken when directories
were added. I'm pretty sure that he's the one to blame, or did it come
from one of the DEC operating systems he used as a model for the
'shell?'

--Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Yes, and the forward slash was used to designate options.

···

On Sep 6, 2006, at 2:16 PM, Rick DeNatale wrote:

On 9/6/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

I recollect an old OS called COS (Cobol Operating System?) That
actually used dot notation to separate directories. Now if only that
would have caught on and our object systems and file system could have
become seemless entiites. He he. I'm dreaming...

Ahh, yes, it's pure DCL thingie carried all they way to cmd.exe. They called it command qualifiers back then :-).

Best,
Mike Dvorkin
http://www.rubywizards.com

···

On Sep 6, 2006, at 10:28 PM, Hal Fulton wrote:

Mike Dvorkin wrote:

Don't think it was DEC. On PDP-11/RSX and VAX/VMS directories were enclosed in square brackets, something like SY:[0,1] or DUA0:[SYS $ROOT.DIR.SUBDIR], always with unique [ ] delimiters.

Yes, the brackets were used that way... but Rick was talking
about the use of slashes for switches (the way Unix uses the
hyphen). That's a DECism, though it may have come from
elsewhere -- as in KJOB /F or simply K/F

Hal

Best,
Mike Dvorkin
http://www.rubywizards.com
On Sep 6, 2006, at 2:16 PM, Rick DeNatale wrote:

On 9/6/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.

If only Gary Kildall had not decided to use / instead of - for
parameter markers in CP/M, so that it wasn't taken when directories
were added. I'm pretty sure that he's the one to blame, or did it come
from one of the DEC operating systems he used as a model for the
'shell?'

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Then of course there was a family of operating systems which started
in the 1960s from a little known computer company named with three
letters like HAL, or JCN, or something like that that used /'s
extensively in it's "shell" language, something like

//STEP1 EXEC PGM=IEBCOPY
//SYSIN DD *
THIS IS SOME DATA
/*
//SYSOUT DD DSN="FRED"

Which was sort of like the equivalent of $cat >FRED

T'was something like that, the memory fades away.

···

On 9/7/06, Trans <transfire@gmail.com> wrote:

I recollect an old OS called COS (Cobol Operating System?) That
actually used dot notation to separate directories. Now if only that
would have caught on and our object systems and file system could have
become seemless entiites. He he. I'm dreaming...

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Rick DeNatale wrote:

I recollect an old OS called COS (Cobol Operating System?) That
actually used dot notation to separate directories. Now if only that
would have caught on and our object systems and file system could have
become seemless entiites. He he. I'm dreaming...

Then of course there was a family of operating systems which started
in the 1960s from a little known computer company named with three
letters like HAL, or JCN, or something like that that used /'s
extensively in it's "shell" language, something like

//STEP1 EXEC PGM=IEBCOPY
//SYSIN DD *
THIS IS SOME DATA
/*
//SYSOUT DD DSN="FRED"

Which was sort of like the equivalent of $cat >FRED

T'was something like that, the memory fades away.

Hmmm ... so *that's* where the C++ comment convention came from -- they
had to do that to comment out the JCL!

True story -- I was once working on a Sigma Nine at Goddard Space Flight
Center. We had a bunch of VIPs touring the lab, and at one point they
came by my terminal. One of them asked me, "What are you doing?" I told
her I was editing a JCL file. She said, "That's JCL? I can actually
*read* it!"

···

On 9/7/06, Trans <transfire@gmail.com> wrote:

HAL?, JCN?, JCL?

Oh now I remember IBM! <G>

···

On 9/7/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

Hmmm ... so *that's* where the C++ comment convention came from -- they
had to do that to comment out the JCL!

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/