Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* QUESTION: Porting Unix Code To GNU C On VAX/VMS...
@ 1997-05-21  4:00 Robert Byer
  1997-05-21  4:00 ` Pat Rankin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Robert Byer @ 1997-05-21  4:00 UTC (permalink / raw)



-----BEGIN PGP SIGNED MESSAGE-----


Hi.

I'm trying to port over a Unix application to VMS using GNU C v2.7.1 and
so far it's going great.

But, I don't have the "unlink" function which is kinda vital for this
application.

My question is, what is the equiv of the Unix "unlink" in GNU C v2.7.1
for VMS or for that matter VAXC.

I don't know all that much acout Unix programming or VAX programming so
I would appreciate any and all help on this.

 +------------------------+--------------------------------------------+
 | Robert Alan Byer       | A-Com Computing, Inc.                      |        
 | Vice-President         | 115 W. Washington Street, Suite 1165       |
 | A-Com Computing, Inc.  | Indianapolis, IN 46204                     |
 | Phone: (317)673-4204   | http:\\www.all-net.net\                    | 
 +------------------------+-----+--------------------------------------+
 | byer@mail.all-net.net        | I don't want to take over the world, |
 | http://www.all-net.net/~byer | just my own little part of it.       |
 +------------------------------+--------------------------------------+
 | Send an E-mail request to obtain my PGP key.                        |
 +---------------------------------------------------------------------+

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQEVAwUBM4Ms7aVSqzlBVJbBAQE/QQgAtWuNRS2sCgfI/a3Fjbl7CqFsCJj6Hpxq
G3+Cb5+DvPqFegFXhFaGZkPozqpJkOCESimUOiLBvK36/TdWbl9U2QRB3D2KM22c
RzFhND1FTWVlBgGcAiWkqsylHdAVOO/ukxmEVlCeGz7DWbss13FVGpDXOPen13/8
kDnHWiY8qbjlRYmRRE0uEBk7rpZf8FeUlrtmPAUYPIQQlh1gaI1TTrJhKzvENLJg
0U01Oc67CrIu2fHRAzb1C555Wp/EaII6yvPmMlaylwxWVmd2f0KuGcJoWVrwvblG
2V0MN1O/p59MW71mGCr8O7AnB0OG99Tvw+QgiN/lE6hrR9FGfIFyKw==
=ZHRm
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: QUESTION: Porting Unix Code To GNU C On VAX/VMS...
  1997-05-21  4:00 QUESTION: Porting Unix Code To GNU C On VAX/VMS Robert Byer
@ 1997-05-21  4:00 ` Pat Rankin
  1997-05-23  4:00 ` Patrick MOREAU, CENA Athis, Tel: 01.69.57.64.40
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Pat Rankin @ 1997-05-21  4:00 UTC (permalink / raw)



In article <1997May21.171439@news.all-net.net>,\
 byer@mail.all-net.net (Robert Byer) writes...
[...]
> My question is, what is the equiv of the Unix "unlink" in GNU C v2.7.1
> for VMS or for that matter VAXC.

     The answer is the same for either compiler since both
assume that you're using VAXCRTL as your C run-time library.
(VAXCRTL is part of VMS rather than being provided by either
compiler.)

     Most of the time unlink() is used simply to delete a file,
so you can just add

#define unlink(X) remove(X)

to the source code and use the ANSI sanctioned method for
deleting a file.  *But* unlink() under Unix actually does
something different whenever the specified file has more than
one directory entry, and there is no general way to emulate
that under VMS.  (Otherwise VAXCRTL would have implemented
it along with the other bits of Unix emulation present.)
There are cases where you could reliably remove directory
entries instead of deleting files, such as when your own
code is creating the alternate directory entries, but it
isn't exactly trivial and you're probably not going to need
generality anyway.

                Pat Rankin, rankin@eql.caltech.edu



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: QUESTION: Porting Unix Code To GNU C On VAX/VMS...
  1997-05-21  4:00 QUESTION: Porting Unix Code To GNU C On VAX/VMS Robert Byer
  1997-05-21  4:00 ` Pat Rankin
  1997-05-23  4:00 ` Patrick MOREAU, CENA Athis, Tel: 01.69.57.64.40
@ 1997-05-23  4:00 ` Stephen Hoff Hoffman
  1997-05-29  4:00 ` Arne Vajhoej
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hoff Hoffman @ 1997-05-23  4:00 UTC (permalink / raw)




In article <1997May21.171439@news.all-net.net>, byer@mail.all-net.net (Robert Byer) writes:

:But, I don't have the "unlink" function which is kinda vital for this
:application.

   Under recent versions of DEC C under recent versions of OpenVMS, one
   has access to a wide variety of UNIX C library calls.  unlink() is
   not one, however.  unlink() is available via the POSIX API, though.
   Also available in both the C library and the POSIX API is delete().

:My question is, what is the equiv of the Unix "unlink" in GNU C v2.7.1
:for VMS or for that matter VAXC.

   unlink() can be used to remove links (aliases) to a file, and --
   when no more links are present -- to delete the file.

   OpenVMS has a "hard link" construct (SET FILE/ENTER, callable
   via the XQP IO$_ACPCONTROL interface), but the typical approach
   to "soft links" is the use of logical names -- a different, and
   arguably more powerful, approach.

   Whether you need to use a hard link, a soft link, or a simple
   delete, depends highly on the particular application...

   And if you have a current "C" license, I would strongly recommend
   installing DEC C.  DEC C can coexist with VAX C on V5.5-2 and
   later.

   As for GNU questions, donno. 

:I don't know all that much acout Unix programming or VAX programming so
:I would appreciate any and all help on this.

   Sounds like fun.  :-)

  -------------------------- pure personal opinion ---------------------------
   Hoff (Stephen) Hoffman   OpenVMS Engineering   h*ffman@xdelta.enet.dec.c*m
     headers and addresses munged to avoid automated spammers: junk-e-mail




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: QUESTION: Porting Unix Code To GNU C On VAX/VMS...
  1997-05-21  4:00 QUESTION: Porting Unix Code To GNU C On VAX/VMS Robert Byer
  1997-05-21  4:00 ` Pat Rankin
@ 1997-05-23  4:00 ` Patrick MOREAU, CENA Athis, Tel: 01.69.57.64.40
  1997-05-23  4:00 ` Stephen Hoff Hoffman
  1997-05-29  4:00 ` Arne Vajhoej
  3 siblings, 0 replies; 5+ messages in thread
From: Patrick MOREAU, CENA Athis, Tel: 01.69.57.64.40 @ 1997-05-23  4:00 UTC (permalink / raw)



In article <1997May21.171439@news.all-net.net>, byer@mail.all-net.net (Robert Byer) writes:
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> 
> Hi.
> 
> I'm trying to port over a Unix application to VMS using GNU C v2.7.1 and
> so far it's going great.
> 
> But, I don't have the "unlink" function which is kinda vital for this
> application.
> 
> My question is, what is the equiv of the Unix "unlink" in GNU C v2.7.1
> for VMS or for that matter VAXC.
> 
> I don't know all that much acout Unix programming or VAX programming so
> I would appreciate any and all help on this.

Try:


/*      Fudge to allow the UNIX unlink() to work        */
#include <descrip.h>
#include <string.h>
#include <lib$routines.h>
unlink(filename)
char *filename;
{
    static struct dsc$descriptor_s file_desc;
    file_desc.dsc$w_length = strlen(filename);
    file_desc.dsc$b_dtype  = DSC$K_DTYPE_T;
    file_desc.dsc$b_class  = DSC$K_CLASS_S;
    file_desc.dsc$a_pointer= filename;
    return (lib$delete_file(&file_desc));
}

(Extracted from XVMS utils Unix emlulation routines)

Patrick

-- 
===============================================================================
pmoreau@cena.dgac.fr  (CENA)     ______      ___   _           (Patrick MOREAU)
moreau_p@decus.decus.fr(DECUS)  / /   /     / /|  /|
CENA/Athis-Mons FRANCE         / /___/     / / | / |   __   __   __   __  
BP 205                        / /         / /  |/  |  |  | |__| |__  |__| |  |
94542 ORLY AEROGARE CEDEX    / /   ::    / /       |  |__| | \  |__  |  | |__|
Web Page: http://www2.cenaath.cena.dgac.fr/~pmoreau/
===============================================================================



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: QUESTION: Porting Unix Code To GNU C On VAX/VMS...
  1997-05-21  4:00 QUESTION: Porting Unix Code To GNU C On VAX/VMS Robert Byer
                   ` (2 preceding siblings ...)
  1997-05-23  4:00 ` Stephen Hoff Hoffman
@ 1997-05-29  4:00 ` Arne Vajhoej
  3 siblings, 0 replies; 5+ messages in thread
From: Arne Vajhoej @ 1997-05-29  4:00 UTC (permalink / raw)
  To: Robert Byer


Robert Byer wrote:
> I'm trying to port over a Unix application to VMS using GNU C v2.7.1 and
> so far it's going great.
> 
> But, I don't have the "unlink" function which is kinda vital for this
> application.
> 
> My question is, what is the equiv of the Unix "unlink" in GNU C v2.7.1
> for VMS or for that matter VAXC.

Asssuming unlink is just used to delete files, then

#define unlink remove

should work fine.

                                                   Arne



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-05-29  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-21  4:00 QUESTION: Porting Unix Code To GNU C On VAX/VMS Robert Byer
1997-05-21  4:00 ` Pat Rankin
1997-05-23  4:00 ` Patrick MOREAU, CENA Athis, Tel: 01.69.57.64.40
1997-05-23  4:00 ` Stephen Hoff Hoffman
1997-05-29  4:00 ` Arne Vajhoej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox