[comp.protocols.nfs] Unix filename from DOS program using PC-NFS

DAVISTD@MSU.BITNET (Tom Davis) (10/17/89)

I need a way to do a FIND_FIRST/FIND_NEXT on a network drive and get at
the Unix filenames.  Is there a straightforward way to do this?  It must
be possible since PC-NFS's ls program does it...  Any ideas?
-------
Tom Davis                 | The above statement shall be construed,
Network Software Services | interpreted, and governed by me alone.
Michigan State University | EMail: davistd@ibm.cl.msu.edu

geoff@hinode.East.Sun.COM (Geoff Arnold @ Sun BOS - R.H. coast near the top) (10/18/89)

In article <135DAVISTD@MSU> DAVISTD@MSU.BITNET (Tom Davis) writes:
>I need a way to do a FIND_FIRST/FIND_NEXT on a network drive and get at
>the Unix filenames.  Is there a straightforward way to do this?  It must
>be possible since PC-NFS's ls program does it...  Any ideas?

What you're actually asking for is a mechanism to do an
inverse map on a DOS-style name to yield the corresponding
NFS name (not necessarily Unix, but I guess I'm just being picky).
We don't publish this because it can change from release to
release: our "ls" knows how to grovel around in the internals
of PCNFS.SYS to get the info. Why didn't we provide a
call into PCNFS.SYS to do it? If we'd thrown in every
such "wouldn't it be nice" function, PCNFS.SYS would have
got even bigger.... and everyone tells me it's too big
already!

There is a backdoor mechanism to open a Unix file (see, you've got me doing
it now!) BY NAME, but it's tricky and it doesn't work with
most C run-time libraries. Why? Because for some unfathomable
reason when you say 

	fd = open("foo",...)

most C's will first issue a "FindFirst" on "foo". Since FindFirst
and FindNext use DOS-defined data structures to hold their
arguments, including the 8.3 filename pattern, long or funny
names can't be used.

The official position (mine, anyway) is that PC-NFS provides
a DOS interface. If you need to access files under DOS and Unix,
make sure the names are compatible, using symbolic or hard links
if necessary. And yes, symbolic links DO work with PC-NFS.
(Last glitches fixed back in 3.0.1.)

Finally, you can always spawn an ls to get the info. That's one
reason the "-b" option was created.

Geoff

[And if you still believe passionately that you just HAVE to do
this, send me email and explain why. I've seen most of the
arguments, but....]

Geoff Arnold,                              Internet: geoff@East.Sun.COM
PCDS Group, Sun Microsystems Inc.
---------------------------------------------------------------------------
"Who's next?" "Me, doctor?" "No, ME doctor, YOU patient." (Graham Chapman, RIP)