summaryrefslogtreecommitdiff
path: root/scripts/modules
diff options
context:
space:
mode:
authoradmin (centauri.fritz.box) <puppet@mx.buetow.org>2014-06-30 23:29:35 +0200
committeradmin (centauri.fritz.box) <puppet@mx.buetow.org>2014-06-30 23:29:35 +0200
commit002c8534bfe2c266959dd42c9c71c17182977d87 (patch)
tree94b09a70cca7346b1361c299c843d316730dde9d /scripts/modules
parent813ee1984130c44f737f27426cc8414d19cf3bd9 (diff)
parent371cf3aa2a132401a4557e227577a9f3a57f4477 (diff)
Merge remote-tracking branch 'remotes/github/0.5-basic' into 0.5-basic0.5-basic
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;