added type and show/files
authordjk <djk>
Sat, 22 May 1999 20:39:20 +0000 (20:39 +0000)
committerdjk <djk>
Sat, 22 May 1999 20:39:20 +0000 (20:39 +0000)
cmd/Aliases
cmd/Commands_en.hlp
cmd/show/files.pl [new file with mode: 0644]
cmd/type.pl [new file with mode: 0644]

index d1f7cfb3caed0f8b505d5005210cb517fee34269..578f86621fe60f260917aa26aa730c63f539e0db 100644 (file)
@@ -100,7 +100,8 @@ package CmdAlias;
          '^sh\w*/w\w*/(\d+)', 'show/wwv $1', 'show/wwv',
     ],
        't' => [
-         '^t', 'talk', 'talk',
+         '^ta$', 'talk', 'talk',
+         '^t$', 'talk', 'talk',
        ],
        'u' => [
        ],
index 20d92d1507b7e29d7df990a2dcbdb916dcfc65ab..61734e449470224b6986bf0a280f51073e069003 100644 (file)
@@ -355,6 +355,16 @@ e.g.
    SH/DXCC G
    SH/DXCC W on 20m info iota
 
+=== 0^SHOW/FILES [<filearea>]^List the contents of a filearea
+SHOW/FILES on its own will show you a list of the various fileareas
+available on the system. To see the contents of a particular file
+area type:-
+   SH/FILES <filearea>
+where <filearea> is the name of the filearea you want to see the 
+contents of.
+
+See also TYPE - to see the contents of a file.
+
 === 0^SHOW/PREFIX <callsign>^Interrogate the prefix database 
 This command takes the <callsign> (which can be a full or partial 
 callsign or a prefix), looks up which internal country number 
@@ -425,6 +435,14 @@ If you know that G3JNB is likely to be present on GB7TLH, but you can only
 see GB7TLH in the SH/C list but with no users, then you would use the
 second form of the talk message.
 
+=== 0^TYPE <filearea>/<name>^Look at the contents of a file in one of the fileareas
+Type out the contents of a file in a filearea. So, for example, in 
+filearea 'bulletins' you want to look at file 'arld051' you would 
+enter:-
+   TYPE bulletins/arld051
+
+See also SHOW/FILES to see what fileareas are available and a list of content
+
 === 0^WX <text>^Send a weather message to local users
 === 0^WX FULL <text>^Send a weather message to all cluster users
 === 5^WX SYSOP <text>^Send a weather message to other clusters only
diff --git a/cmd/show/files.pl b/cmd/show/files.pl
new file mode 100644 (file)
index 0000000..68526a4
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# the show/files command, list bulls, files and areas 
+#
+# The equivalent of LS in other words
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @f = split /\s+/, $line;
+my $root = "$main::root/packclus";
+my @out;
+my @file;
+my @d;
+my @slot;
+
+if (@f) {
+       my $fn = lc $f[0];
+       $fn =~ s/\\/\//og;
+       $fn =~ s/\.//og;
+       $fn =~ s/^\///og;
+       $root = "$root/$fn";
+}
+
+opendir(DIR, $root) or         return (1, $self->msg('e3', 'show/files', $f[0]));
+@file = sort readdir(DIR);
+closedir(DIR);
+
+my $flag = 0;
+for (@file) {
+       next if /^\./;
+       my $fn = "$root/$_";
+       my $size;
+       
+       @d = stat($fn);
+       if (-d $fn) {
+               $size = "DIR";
+       } else {
+               $size = $d[7]
+       }
+       $slot[$flag] = sprintf("%-10.10s %7.7s %s", $_, $size, cldatetime($d[9]));
+       $flag ^= 1;
+       if ($flag == 0 && @slot >= 2) {
+               push @out, "$slot[0] $slot[1]";
+       }
+}
+push @out, $slot[0] if $flag;
+return (1, @out);
+
+
diff --git a/cmd/type.pl b/cmd/type.pl
new file mode 100644 (file)
index 0000000..e525f94
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# the type command, display bulls and files
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @f = split /\s+/, $line;
+my $root = "$main::root/packclus";
+my @out;
+my @file;
+my @d;
+my @slot;
+
+if (@f) {
+       my $fn = lc $f[0];
+       $fn =~ s/\\/\//og;
+       $fn =~ s/\.//og;
+       $fn =~ s/^\///og;
+       $root = "$root/$fn";
+}
+
+open(INP, $root) or return (1, $self->msg('e3', 'type', $f[0]));
+@out = <INP>;
+close(INP);
+
+return (1, @out);