[comp.sys.next] /LocalApps and NXPortFromName

dwatola@NEXTASY2.EECS.WSU.EDU (David Watola) (03/13/91)

two questions:

1)  what is the proper way to use NXPortFromName()?  the documentation says
    that if the specified port is not registered with the workspace manager,
    then the manager tries to launch the application.  this does not seem to
    be working for me, although the answer to the second question (below)
    may have something to do with this.  i have resorted to other (read
    kludgy) methods for ensuring that my remote servers get launched when
    needed.  actually, this behavior makes me wonder about the "can't connect
    with Edit" messages i get from gdb when trying to use 'view' if Edit hasn't
    been previously launched (or using openfile with it hasn't been launched).
    one would think that these programs would use NXPortFromName...  Edit is
    most certainly in the manager's search path...  (and my problem server was
    in /LocalApps).

2)  does anyone else have a problem with applications in /LocalApps not being
    found by the workspace manager?  i am running a standalone 'station at 
    home.  when i am logged in as root, /LocalApps is searched and all of
    the suffixes corresponding to applications there are recognized.  but if
    i log in under my usual account (which is not "me", but actually "dwatola")
    it is not searched.  this problem does not appear on my account at school
   (i.e. networked environment).  can anybody explain this?  better yet, can
    anybody tell me how to fix this?  i kind of suspect that my problem with
    NXPortFromName() not launching the proper server may be in the fact that
    it is not looking in /LocalApps...  so WTF?

thanks, anyone.

dwatola@nextasy2.eecs.wsu.edu
dwatola@yoda.eecs.wsu.edu

scott@erick.gac.edu (Scott Hess) (03/14/91)

In article <9103130342.AA00394@nextasy2.eecs.wsu.edu> dwatola@NEXTASY2.EECS.WSU.EDU (David Watola) writes:
    needed.  actually, this behavior makes me wonder about the "can't connect
    with Edit" messages i get from gdb when trying to use 'view' if Edit hasn't
    been previously launched (or using openfile with it hasn't been launched).
    one would think that these programs would use NXPortFromName...  Edit is
    most certainly in the manager's search path...  (and my problem server was
    in /LocalApps).

At least in 1.0, it seems there was a named socket used by Edit to allow
openfile to work.  It was located down in ye olde /tmp directory.  I
don't see it there right now, though, so maybe it's changed.  But, openfile's
man page specifically states that it will not open the file unless Edit
is running.

  2)  does anyone else have a problem with applications in /LocalApps not being
      found by the workspace manager?  i am running a standalone 'station at 
      home.  when i am logged in as root, /LocalApps is searched and all of
      the suffixes corresponding to applications there are recognized.  but if
    i log in under my usual account (which is not "me", but actually "dwatola")
      it is not searched.  this problem does not appear on my account at school
      (i.e. networked environment).  can anybody explain this?  better yet, can
      anybody tell me how to fix this?  i kind of suspect that my problem with
      NXPortFromName() not launching the proper server may be in the fact that
      it is not looking in /LocalApps...  so WTF?

The problem is that /LocalApps has been removed from the workspace's
default search paths in 2.0.  For some odd reason.  So, if you have
an account that existed before 2.0, it will still look there (as
your default will carry over), while new accounts won't.

To change it, use DefaultMgr (or be brave and use dread/dwrite) and
muck with the Workspace ApplicationPaths default.  Mine:

Workspace ApplicationPaths ~/Apps:/LocalApps:/NextApps:/NextDeveloper/Apps:/NextAdmin:/NextDeveloper/Demos:/usr/hosts

This should help (note that you might have to logout and back in to
get that to take effect).  I know that this stuff works, because I've
done it.  I would recommend getting it to work in your personal
~/Apps directory first, and then moving it to LocalApps.

Later,
--
scott hess                      scott@gac.edu
Independent NeXT Developer	GAC Undergrad
<I still speak for nobody>
"Tried anarchy, once.  Found it had too many constraints . . ."
"I smoke the nose Lucifer . . . Banana, banana."

glenn@heaven.woodside.ca.us (Glenn Reid) (03/15/91)

In article <SCOTT.91Mar13120030@erick.gac.edu> scott@erick.gac.edu (Scott Hess)  
writes:
> At least in 1.0, it seems there was a named socket used by Edit to allow
> openfile to work.  It was located down in ye olde /tmp directory.  I
> don't see it there right now, though, so maybe it's changed.  But, openfile's
> man page specifically states that it will not open the file unless Edit
> is running.

There is a better way to open files with Edit.  It doesn't even require that
Edit be running.  There is a new -a switch added to the "open" command in
2.0 that lets you explicitly supply the name of the application in which to
open the file (rather than letting the workspace determine it based on the
file extension).  For example, to open a PostScript file in Edit (instead of
the default Preview), do this:

	localhost> open -a Edit myfile.ps

If you don't like to type, you could always alias "openfile" to "open -a Edit"
and you get the best of both worlds, and no more of those "Can't connect to
Edit" messages.

 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		NeXT/PostScript developers
 ..{adobe,next}!heaven!glenn		415-851-1785 (fax 851-1470)

dwatola@NEXTASY2.EECS.WSU.EDU (David Watola) (03/15/91)

ok, both problems solved!

as far as me not getting NXPortFromName() to work as documented, i received
email from dave moore at next, who said that it was broken and should be fixed
in the next release.

and /LocalApps is now part of my workspace manager search path.  i still don't
understand why it is not searched automagically though, since i didn't have to
mess with the defaults on the root account for owner Workspace yet it searches
/LocalApps.  thanks scott.  ah, well, quickfix hacks beat migraines any day.