On Tue, 12 Nov 2002 21:08:08 GMT, [EMAIL PROTECTED] (Gerrit P. Haase)
wrote in news:8-1996164353.20021112220808@;familiehaase.de: 

>> So my present analysis is that my module belongs in a base namespace
>> of "Filesys::" and maybe could be named "CygwinPaths"? I think it
>> would keep the maintainer of Cygwin Perl happy -- or should -- if
>> named like this. 

Gerrit is the maintainer of the Cygwin Perl package. I am Soren Andersen.

In order to try to alleviate any confusion that might be generated by the 
situation, I am going to re-post my original message under this thread.

I posted to the Cygwin List under a differing, second Subject:: because my 
original post, which was under the same Subject as the original post here 
("Where it runs or what it Does?") did not show up. I thought Gmane had 
lost it but the connection-break was downstream of that: Cygwin got it but 
it never made it back to Gmane (the link between Cygwin's List server and 
Gmane was somehow down for about a day). So I posted a redundant msg to 
Cygwin in error.

Now Gerrit's reply is the top of this thread and not enough of my original 
post is included within it (quoted) to convey my proposal. So the remainder 
of this message is a (slightly edited) reprise of that original.

  Thx, and sorry for any confusion. These things happen.

     Soren A

---------------------------------------------------------------------------
Subject: Where it runs or what it Does?? (RFC)
Date: Mon, 11 Nov 2002 17:56:00 -0500

---------------------
Hi Good Folks,

"namespace" advice requested. I have written an extension module that I
need to name and get uploaded to CPAN. 

My Subject: line means that as I see it there are two common approaches
to naming modules: where it runs ("BSD::Foo"), or what it does
("Filesys::Bar"). My inclination is to try to use 'what it does' FIRST
and only resort to "where it runs" when I need to make it clear that
there's a special purpose for the module; that it is platform-specific
in some sense. I think this is (at least partially) correct Perl 
philosophy.

The oddball module I've written is for doing some path manipulations on
Cygwin. Cygwin is and yet isn't a "platform"; it's a posix overlayer
running above Microsoft Windows. It emulates *nix to such a degree that
normally we don't think about anything Cygwin-specific needing to be
added; Cygwin Perl is just a very basic vanilla *nix perl with no
special functionality added. Contrast with ActivePerl, which is Win32
Perl and that means special namespaces defined and all sorts of extra
stuff (modules) thrown in. 

But there's a little fly (in my ointment). Cygwin Perl can run in all
sorts of different contexts and be used for many uses. Someday somewhere
somebody is going to be using Cygwinperl and want to have it tell
another application FooMe.exe (thru a 'system()' call, for ex.) that it
wants FooMe to do something with the file
"/cygdrive/r/obscure/directory/dirtypictures.jpg" or "~/.initme_rc" or
"/tmp/*.doc". And that app FooMe is a Windows app that knows nothing
about posix-style paths and will upchuck on the argument.

In fact, I think this HAS already happened, amazingly, to somebody,
somewhere ;-) .

So this module will offer the very simple service of some subroutines
that will take a path as an input arg and return a path. There are four
subs right now (the XSUBS are named something longer; these are perl
subs): 

   posixpath
   win32path
   fullposixpath
   fullwin32path

[ sma -No, there are 5: the above, + "vetted_path()"]

And they do just about what you'd think from the names, mostly.

The implementation uses access to the Cygwin C API through XS glue.

It's important for correct understanding of the need for this module to
have it's own namespace, to grasp that on *cygwin*, there is always going
to be more than one canonical-ly-correct way to refer to a file by path
name (!!):  

   /posixstyle/file.name

   --VS--

   R:\something\mounted\to\posixstyle\file.name

   --OR--

   R:/something/mounted/to/posixstyle/file.name

Which last, Cygwin is also perfectly happy to accept and is IMHO the
ideal "happy medium" or lingua franca for most "hybrid" situations on
Cygwin. People are calling this a "mixed" path. 

That's a difference. A psuedo-filesystem difference, IMO. But like it or 
not, find it 'easy to categorize' or not, there IS a difference (between 
generic *nix perl and Cygwin perl).

So my present analysis is that my module belongs in a base namespace of 
"Filesys::" and maybe could be named "CygwinPaths"?

   Best,
    Soren A

---------------------------------------------------------------------------

-- 
  conway: unit of mind expansion.
One Conway == ~20 lines of Perl code found in
$CPAN/authors/id/D/DC/DCONWAY, which gives the
sensation of your brain being wrapped around a
brick, with kiwi juice squeezed on top.
        -- Ziggy (via Schwern)


Reply via email to