
! script name: archive.d/archivelist
! topic: List a file archive directory tree

!A
!A NAME:
!A
!A 	List a file archive directory tree
!A
!A DESCRIPTION:
!A
!A	This script lists everything in the synergy archive into a
!A	message box.
!A
!B INSTRUCTIONS:
!B
!B	The following options are available:
!B
!B		File_type= 0     Full list.
!B		File_type= 1     Directories with revision files.
!B		File_type= 2     Files only.
!B		File_type= 3     Project List with Directories.
!B
!B		List_type= 0	 List with spaces
!B		List_type= 1	 Full path list
!B
!# see also - htdocs/help.d/archive.htm

DIM Answer$[256],Destination$[256]
DIM Archive$[512]
DIM Filename$[512]

DeActivateUndo
Stat=ChangeLabelStr("ScriptNameStatus","Function: archive ")

Filename$= "tempdata"

File_type=0
List_type=0
IF ARGC>1 THEN
	A$= ARGV(1)
	File_type= VAL(A$)
	IF ARGC=3 THEN
		A$= ARGV(2)
		List_type= VAL(A$)
	END IF
END IF

Stat= NamedVarStr("archive dir",WsSystemVars,"/usr/weber/archive/",Archive$)

Stat= DirTreeListFile(Archive$,Filename$,List_type,File_type)

Stat=MessageFileBox(Filename$,"ARCHIVE:"&Archive$)



Leave:!
Stat=SetInputFormat("n4","")
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
