#
# SYNOPSIS
# 
# require "readdir.pl";
# @files = &readdir();
#
# DESCRIPTION
# 
# &readdir is a simple interface to perl's readdir builtin.  It returns
# all the files at once.  It dies if it can't open the directory.  
#
# The special directories "." and ".." are not included in the return value.
#
# AUTHOR
#
# David Muir Sharnoff <muir@idiom.com>
#


# Copyright (C) 1994, David Muir Sharnoff

sub readdir
{
	local($d) = @_;
	local(*D);
	local(@r);

	opendir(D,$d) || die "opendir $d: $!";
	@r = grep($_ ne "." && $_ ne "..", readdir(D));
	closedir(D);
	return @r;
}

1;