[comp.lang.pascal] System Calls from a Pascal program

edsall@maxwell.physics.purdue.edu (David M. Edsall) (02/16/90)

    Can anyone out there give the procedure and/or function calls that should
be used to do a Unix system call from inside of a Pascal program. The syntax
and an example would be helpful as well. What I am looking for is a way to
create a directory from inside a Pascal program. In Fortran all I would need
to do is something like

       call system('mkdir <fn>')

or something of that nature.


     My department is using a Vax running 4.3 BSD Unix.

   Thanks,

 - dave

bigelow@hpfcso.HP.COM (Jim Bigelow) (02/17/90)

Hi Dave,

>    Can anyone out there give the procedure and/or function calls that should
> be used to do a Unix system call from inside of a Pascal program. The syntax
> and an example would be helpful as well. What I am looking for is a way to
> create a directory from inside a Pascal program.

In HP pascal on the HP9000/S300 all that's required is to  declare the 
C library routine as external, e.g., 
    	function mkdir $alias '_mkdir'$ (
	    	path :str; 
	    	mode: integer): integer; external;
Converting the pascal string to a C null terminated string is a little tricky!

Good luck,

Jim Bigelow
S300 Pascal