comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL: from Sun to MsWindows
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL: from Sun to MsWindows [message #1092 is a reply to message #1091] Thu, 03 June 1993 11:31 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
PRO CONCAT4DOS
;+
; NAME:
; CONCAT4DOS
; PURPOSE:
; Concatenates IDL procedure files together into a form suitable for
; copying to a DOS machine.
; CALLING SEQUENCE:
; CD, directory ;(go to desired directory)
; CONCAT4DOS
; PARAMETERS:
; None.
; OPTIONAL KEYWORD PARAMETERS:
; None.
; COMMON BLOCKS:
; None.
; SIDE EFFECTS:
; A "dos" subdirectory is created. On VMS machines, a temporary command
; file called "CONCAT4DOS.COM" is created and then destroyed.
; RESTRICTIONS:
; None.
; PROCEDURE:
; All the .PRO files in the current directory are copied into a special
; "dos" subdirectory, with the following changes made:
;
; 1. All filenames are truncated to eight characters.
; 2. All procedure files with names beginning with the same
; first eight characters are concatenated together into a
; single file.
;
; MODIFICATION HISTORY:
; William Thompson, August 1992.
;-
;
ON_ERROR,2
;
; First make sure there are procedure files in the current directory.
;
FILES = FINDFILE('*.pro',COUNT=N_FILES)
IF N_FILES EQ 0 THEN MESSAGE,'No procedure files found'
;
; Next, look for an existing "dos" directory. On VMS machines, open up a
; command file to store all subsequent commands. All the commands will then
; be executed at the end with a single spawn.
;
IF !VERSION.OS EQ 'vms' THEN BEGIN
OPENW,UNIT,'CONCAT4DOS.COM',/GET_LUN
PRINTF,UNIT,'$ SET VERIFY'
DOSDIR = 'DOS.DIR'
END ELSE DOSDIR = 'dos'
DOSDIRFILE = FINDFILE(DOSDIR,COUNT=N_FOUND)
;
; If an existing directory was found, then warn the user that all the ".pro"
; files in that subdirectory will be deleted, and ask if the user wants to
; continue. If yes, then delete the files.
;
IF N_FOUND NE 0 THEN BEGIN
PRINT,'DOS directory already found'
PRINT,'All .PRO files in the DOS directory will be deleted.'
ASK,'Continue? ',ANSWER,'YN'
IF ANSWER EQ 'Y' THEN BEGIN
IF !VERSION.OS EQ 'vms' THEN BEGIN
PRINTF,UNIT,'$ DELETE/NOLOG/NOCONFIRM ' + $
'[.DOS]*.PRO;*'
END ELSE BEGIN
COMMAND = 'rm dos/*.pro'
PRINT,'$ ' + COMMAND
SPAWN,COMMAND
ENDELSE
END ELSE RETURN
;
; Otherwise, create the subdirectory.
;
END ELSE BEGIN
IF !VERSION.OS EQ 'vms' THEN BEGIN
PRINTF,UNIT,'$ CREATE/DIRECTORY [.DOS]'
END ELSE BEGIN
COMMAND = 'mkdir dos'
PRINT,'$ '+COMMAND
SPAWN,COMMAND
ENDELSE
ENDELSE
;
; For each file, determine the eight character equivalent, and copy all files
; beginning with those eight characters into a single file.
;
LAST = ''
FOR I=0,N_FILES-1 DO BEGIN
FDECOMP,FILES(I),DISK,DIR,NAME,EXT,VER
NAME8 = STRMID(NAME,0,8)
IF NAME8 NE LAST THEN BEGIN
IF STRLEN(NAME8) EQ 8 THEN NAME9 = NAME8 + '*' ELSE $
NAME9 = NAME8
IF !VERSION.OS EQ 'vms' THEN BEGIN
PRINTF,UNIT,'$ COPY ' + NAME9 + $
'.PRO [.DOS]' + NAME8 + '.PRO'
END ELSE BEGIN
COMMAND = 'cat ' + NAME9 + '.pro > dos/' + $
NAME8 + '.pro'
PRINT,'$ ' + COMMAND
SPAWN,COMMAND
ENDELSE
ENDIF
LAST = NAME8
ENDFOR
;
; On VMS machines, tell the command file to delete itself after processing,
; and execute it.
;
IF !VERSION.OS EQ 'vms' THEN BEGIN
PRINTF,UNIT,'$ DELETE/NOLOG/NOCONFIRM CONCAT4DOS.COM;*'
FREE_LUN,UNIT
SPAWN,'@CONCAT4DOS.COM'
ENDIF
;
RETURN
END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL & Sybase
Next Topic: Re: New IDL Update Policy

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 05:19:49 PDT 2025

Total time taken to generate the page: 1.20283 seconds