
#   
# sequencer.pli	- generate .TIC sequence numbers
#
#   sequencer.pli,v 1.1 1994/03/19 16:34:53 cg Exp
#
#   Filebase - filebase management for Unix systems
#   Copyright (C) 1994	Cees de Groot
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#   
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#   You can contact the author
#   by SnailMail:	Cees de Groot
#			Ortsstrasse 1a
#			88718 Daisendorf
#			Germany
#   by Phone:            +49 7532 5131
#   by InternetMail:     de_groot@decus.decus.de
#   on his Box:          +49 7532 2532 (14k4/V42bis)
#
#

#
# This file contains the sub 'Sequencer', which will generate a 
# Sequence number from the Sequence file, prefixed with lt, 
# suffixed with .tic. The lt stands for 'Linux Tic', of course :-)
#
# Output: $SequenceFileName
#
sub Sequencer {

	#
	# Generate the thing, if not there
	#
	if (! -f "$FileBase/$Sequencer") {
		system "echo 0 >$FileBase/$Sequencer";
	}

	#
	# Get the next sequence number.
	#
	open(Sequence, "$FileBase/$Sequencer");
	$Number = <Sequence>;
	close(Sequence);
	$Number++;
	system "echo $Number >$FileBase/$Sequencer";

	$SequenceFileName = sprintf("lt%06x.tic", $Number);
	print "File = $SequenceFileName\n";
}

1;

#
# sequencer.pli,v
# Revision 1.1  1994/03/19  16:34:53  cg
# Filebase first version that functions more or less. More a 'backup'
# commit than a real release...
#
#
