summaryrefslogtreecommitdiff
path: root/scripts/modules
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-11-21 16:18:43 +0000
committerPaul Buetow <paul@buetow.org>2010-11-21 16:18:43 +0000
commit7fa0ff180b35e7fef218f0b9113d7e0f3f9b54a8 (patch)
treee45ffca8cf18ac5d00a2928229d8a717a3718669 /scripts/modules
parentc155ee9e0f133aafff70984f5b09c45efc62ca5a (diff)
parent55b08bd93257d32df76efc4e8e3f49311c39ee82 (diff)
Diffstat (limited to 'scripts/modules')
-rw-r--r--scripts/modules/file.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/modules/file.pm b/scripts/modules/file.pm
new file mode 100644
index 0000000..b11e2b3
--- /dev/null
+++ b/scripts/modules/file.pm
@@ -0,0 +1,28 @@
+sub dopen
+{
+ my $shift = shift;
+ opendir DIR, $shift or die "$shift: $!\n";
+ my @dir = readdir(DIR);
+ closedir DIR;
+ return @dir;
+}
+
+sub fopen
+{
+ my $shift = shift;
+ open FILE, $shift or die "$shift: $!\n";
+ my @file = <FILE>;
+ close FILE;
+ return @file;
+}
+
+sub fwrite
+{
+ my $shift = shift;
+ my @file = @_;
+ open FILE, ">$shift" or die "$shift: $!\n";
+ print FILE @file;
+ close FILE;
+}
+
+1;