[comp.lang.pascal] Sun 4 Pascal compiler

raj@pic.ucla.edu (Shiladitya Raj Chaudhury) (09/07/89)

Is there anyone out there who is actually USING this compiler? We have one on
order from SUN for MONTHS, but still there is no sign of it.  Repeated calls
to the sales rep here in Los Angeles seem to do no good.  I would appreciate
any comments from people with experience on the SUN 4 'pc'. 

Also would be interested in Martin Jourdan's file existence testing code for the
SUN 'pc'.

Raj Chaudhury
Program In Computing
UCLA, LA

schwartz@shire.cs.psu.edu (Scott Schwartz) (09/07/89)

In article <20792@adm.BRL.MIL> Shiladitya Raj Chaudhury writes:

| Is there anyone out there who is actually USING this compiler? We have one on
| order from SUN for MONTHS, but still there is no sign of it. 

We have it, and lots of people use it routinely.

| I would appreciate
| any comments from people with experience on the SUN 4 'pc'. 

I've done a little with it.  Not enough to have any war stories though.
It's nice to have an actual ISO level 1 compiler.

| Also would be interested in Martin Jourdan's file existence testing code 
| for the SUN 'pc'.

The compiler seems to fit into the Sun/Unix environment very well.  As
has been mentioned previously, it is trivially easy to call routines
from other languages (and therefore the unix library libc).  The
pascal manual explains in great detail, with lots of examples, how to
do this.  

As far as file existence testing goes, rather than using "access"
(from libc) to do it, you should write a little routine in C that
tries to open the file (simply closing it again if the open succeeds)
and then returns status.  Then call that routine from pascal.  The
reason to use "open" instead of "access" is that "access" may not do
what you expect if you call it from a program running set-uid.  This
is documented in the man page: Security mavens, take note!

Just as an example, here is how you use the unix library
routine "open" from Sun Pascal:

function open (path: packed array [lb..ub: integer] of char;
               flags: integer;
               mode: integer): integer;
external c;

...

file_descriptor := open ('foo.bar', 0, 0);

--
Scott Schwartz		<schwartz@shire.cs.psu.edu>
"APAR's?  We don' neeed no steeenking APARS!"

ts@chyde.uwasa.fi (Timo Salmi LASK) (09/07/89)

In article <20792@adm.BRL.MIL> raj@pic.ucla.edu (Shiladitya Raj Chaudhury) writes:
>Is there anyone out there who is actually USING this compiler? We have one on

Yes, at least yours truly.
...................................................................
Prof. Timo Salmi                                (Site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun