	Function modvolume_inf, volfn, dest, logdiscna, archdir, pre=pre, $
				weekid=weekid
;	---------------------------------------------------------
;+						6-Mar-96
;	NAME: modvolume_inf
;	PURPOSE: modify the "volume.inf" files for YMI-makedisc
;		procedure of creating CDRs.
;	PARAMETERS:
;		RETURNED 	1 for sucess and 0 for error or failure
; 
;		volfn		input fully qual. file name of volume.inf file
;		dest		input dest. for the CD, default is LMATC
;		logdiscna	ret. string for logging the disc making.
;		archdir		ret. string for archive dir. for files.
;		pre		ret. PREfix string for /ydb archives.
;		weekid		input for finding nametape and logging name
;	History:
;		created 6-Mar-96, gal
;		modified 27-Sep-96, gal
;-
;	----------------------------------------------------------

;       Update the Volume.inf file
        text = rd_tfile(volfn)

	arcweek = 0 & ydb = 0 & gen = 0	; init. types of CD
	res = strpos(volfn,'week')	; Using volfn test for actual type
	if (res ne -1) then begin
		arcweek = 1
	endif else begin
		res = strpos(volfn,'ydb')
		if (res ne -1) then begin
			ydb = 1
		endif else gen = 1
	endelse

        voln = strmid(text(4),3,strlen(text(4))-4)	; volume name
        vols = strmid(text(5),3,strlen(text(5))-4)	; set name

	print, ' '
        print, 'CD Volume information:
	print, 'Current Formal Volume name: ', voln
	print, 'Current Set name: ', vols
	print, ' '
        ans = 'y'
	print, 'Note: Use only alphanum-chars and "_" in the volume/set names'
        print,  ' '
	input, 'Update this information?', ans, ans

        if (strupcase(ans) eq 'Y') then begin

	  if (arcweek) then begin		; break vol to> yr, wk, letter
;print,'arcweek -path..'
	    yr	   = strmid(voln,0,2)
	    wno    = strmid(voln,3,2)
	    input, 'Update the Year?', yr, yr
	    strput, voln, yr, 0
	    input, 'Update the week number?', wno, wno
	    strput, voln, wno, 3
	    voln = strUpcase(yr+'_'+wno+'a')
	    strtemp = 'VI"'+voln+'"'
	    text(4) = strtemp	    	    
	    archdir = voln
	  endif

	  if (gen) then begin			; no break for gen
;print,'gen -path...'
	    input, 'Enter new Formal Vol. name?', voln, voln
	    voln = str2alp(voln,plus='_',/num)	; clean the volume name
	    voln = strUpcase(voln)
	    strtemp = 'VI"'+voln+'"'
	    text(4) = strtemp
;print, "New Vol. name string: ", strtemp
	    input, 'Enter new Set name?', vols, vols
	    vols = str2alp(vols,plus='_',/num)	; clean the Set name
	    vols = strUpcase(vols)
	    strtemp = 'VS"'+vols+'"'
	    text(5) = strtemp
;print, "New Set name string: ", strtemp
	    archdir = ''			; empty string
	  endif

	  if (ydb) then begin			; break vol.to> prefix,yr,letter
;print,'ydb -path...'
	    pre = strlowcase(strmid(voln,0,3))
	    yr  = strlowcase(strmid(voln,3,2))
	    sno = strlowcase(strmid(voln,6,2))	; alpha number (a,b,c...)
	    input, 'Update the prefix?', pre, pre
	    strput, voln,pre,0
	    input, 'Update the year?', yr, yr
	    strput, voln,yr, 3
	    input, 'Update the start-week number?', sno, sno
	    strput, voln,sno,6
	    voln = strUpcase(voln)
	    voln = strUpcase(pre+yr+'_'+sno)
;print,'voln-- should be upcase?',voln
	    strtemp = 'VI"'+voln+'"'
	    text(4) = strtemp
	    strput, vols, pre,0
	    vols = strUpcase(vols)
	    strtemp = 'VS"'+vols+'"'
	    text(5) = strtemp
	    archdir = strlowcase(pre+yr+'_'+sno) ; define archive directory
	  endif
        endif else begin
	  if (arcweek) then archdir = voln 
	  if (gen) then archdir = ''	
	  if (ydb) then begin
	    pre = strlowcase(strmid(voln,0,3))
	    yr  = strlowcase(strmid(voln,3,2))
	    ano = strlowcase(strmid(voln,6,2))	; alpha number (a,b,c...)
	    archdir = strlowcase(pre+yr+'_'+sno); define archive directory	
	  endif
        endelse

	file_append, volfn, text, /newfile      ; write the new volume.inf
        modcmd = 'chmod 777 '+volfn

        modcmd = str2arr(modcmd, del=' ')
        spawn, modcmd, /noshell

        st = strmid(!stime, 0, 17)
	user = get_user()
        logdiscna = voln+' | '+st

	binaryweekid = Keyword_set(weekid)
	if (binaryweekid) then begin
		tapenam = get_tapename(weekid)
	endif
        if (n_elements(dest) ne 0) then begin
		if (binaryweekid) then begin
		  logdiscna = logdiscna+' | '+dest+' | '+user+' | '+tapenam
		endif else begin
		  logdiscna = logdiscna+' | '+dest+' | '+user
		endelse
	endif else begin
		if (binaryweekid) then begin
		  logdiscna = logdiscna+' | '+'LMATC'+' | '+user+' | '+tapenam
		endif else begin
		  logdiscna = logdiscna+' | '+'LMATC'+' | '+user
		endelse
	endelse

print, 'New log discName: ', logdiscna

	return, 1			; assume no errors
	END
