Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!noao!stsci!barsh From: barsh@stsci.EDU (John Barshinger) Newsgroups: comp.os.vms Subject: RE: $TRNLNM System Service problen in VAX C Message-ID: <122@ra> Date: Tue, 1-Dec-87 20:04:27 EST Article-I.D.: ra.122 Posted: Tue Dec 1 20:04:27 1987 Date-Received: Sat, 5-Dec-87 03:23:33 EST Organization: Space Telescope Science Institute, Baltimore, MD 21218 Lines: 60 Keywords: C, $TRNLNM, SystemService This is an example of using the ss $TRNLNM in VAX C. This is in response to a problem someone had earlier. Sorry about posting this instead of mailing, my mailer can't find anybody (the link is down) Jeremy, here's a working version, hope it helps... jrbii ~~~~~ #include stdio #include descrip #include ssdef #include lnmdef typedef struct { short buflen; short itemcode; char *buff_addr; short *retlen_addr; int terminator; } item_descriptor; main () { $DESCRIPTOR(tabnam,"LNM$FILE_DEV"); $DESCRIPTOR(lognam,"SYS$COMMAND"); char device_name[256]; short return_length; int status; item_descriptor itemlist = { 256, LNM$_STRING, device_name, &return_length, 0}; status = sys$trnlnm(0,&tabnam,&lognam,0,&itemlist); if ( status != SS$_NORMAL) return(status); device_name[return_length]=0; if (device_name[0] = 27) /* see system service man pg. 6-10 */ strcpy(device_name, &device_name[4]); printf("%s\n",device_name); } -- John Barshinger Space Telescope Science Institute Baltimore, MD 21218 plink:jrbii | bix:jrbii | barsh@stsci.edu