Jim,
We try to minimise on UDC's so if you are OK with using command files
here is what we use:
<cut>
parm name='?', result=!name
if lft('!name',1) = '?' then
setvar s chr(14)
setvar b chr(14)+':'+chr(15)
echo
![s+'R;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'
]
echo ![b+' MPE2HFS - Converts an MPE filename to an HFS (POSIX)
pathname.']
echo
![s+'5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'
]
echo ![b+'']
echo ![b+' Syntax:']
echo ![b+' MPE2HFS name [result]']
echo ![b+'']
echo ![b+' Parameters:']
echo ![b+' name CI variable containing the MPE filename']
echo ![b+' result CI variable returning the converted HFS
pathname']
echo ![b+' (the name used defaults to the name parameter
value)']
echo ![b+'']
echo ![b+' Restrictions:']
echo ![b+' None.']
echo ![b+'']
echo
![s+'F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'
]
#
# Author: Robert W.Mills
#
# Modification History can be found at the end of this file.
#
deletevar s, b
return
endif
setvar mpe2hfs_name ups('!name')
setvar mpe2hfs_part wordcnt('!mpe2hfs_name','.')
if mpe2hfs_part = 1 then
setvar !result './!mpe2hfs_name'
elseif mpe2hfs_part = 2 then
setvar mpe2hfs_file word('!mpe2hfs_name','.',1)
setvar mpe2hfs_group word('!mpe2hfs_name','.',2)
setvar !result '/!hpaccount/!mpe2hfs_group/!mpe2hfs_file'
else
setvar mpe2hfs_file word('!mpe2hfs_name','.',1)
setvar mpe2hfs_group word('!mpe2hfs_name','.',2)
setvar mpe2hfs_account word('!mpe2hfs_name','.',3)
setvar !result '/!mpe2hfs_account/!mpe2hfs_group/!mpe2hfs_file'
endif
deletevar mpe2hfs_@
return
#-- DO NOT ENTER EXECUTABLE CODE AFTER ABOVE 'RETURN' STATEMENT.
Modification History:
Versn | Date | Who | Reason for Change
------+------------+-----+------------------------------------------
01.00 | 27/03/2002 | RWM | Initial version.
#===================================================================
# End of command file.
#===================================================================
</cut>
regards,
Robert W.Mills
MIS Systems Development Manager
Windsong Services
+44 (0)20 8309 3604
-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On
Behalf Of James B. Byrne
Sent: 29 November 2005 03:34
To: [log in to unmask]
Subject: Re: [HP3000-L] MPE to HFS name conversion
On 28 Nov 2005 at 10:06, Paul H Christidis wrote:
> setvar PosixName FINFO("MpeName", "posixfullfname")
This only works if the file exists. One is thus required to script to
test for the file, create it if it does not already exist, and then use
the technique given. My solution, albeit not constructed for the
general case, is:
SETVAR _SD_HFS_ "![DIRNAME('!_SD_')]"
IF LEN('!_SD_HFS_') = 0 THEN
SETVAR _SD_HFS_ "./"
ELSE
SETVAR _SD_HFS_ "!_SD_HFS_" + "/"
ENDIF
SETVAR _SD_HFS_ "!_SD_HFS_" + "![BASENAME('!_SD_')]"
ECHO !_SD_HFS_
There is also a UDC provided in the HPPXUDC.PUB.SYS file called
MPETOHFS. The difficulty with this solution being my reluctance to
employ UDCs within JOB files.
Regards,
Jim
--
*** e-mail is NOT a secure channel ***
James B. Byrne mailto:ByrneJB.<token>@Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3CE delivery <token> = hal
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|