DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T v

⟦022da8e5d⟧ TextFile

    Length: 1338 (0x53a)
    Types: TextFile
    Names: »vanish«

Derivation

└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen
    └─⟦b5330643c⟧ »./cops/perl-4.019/perl.tar.Z« 
        └─⟦2b9a58213⟧ 
            └─⟦this⟧ »perl-4.019/eg/van/vanish« 

TextFile

#!/usr/bin/perl

# $Header: vanish,v 4.0 91/03/20 01:16:05 lwall Locked $

sub it {
    if ($olddir ne '.') {
	chop($pwd = `pwd`) if $pwd eq '';
	(chdir $olddir) || die "Directory $olddir is not accesible";
    }
    if (!-d .deleted) {
	print `mkdir .deleted; chmod 775 .deleted`;
	die "You can't remove files from $olddir" if $?;
    }
    $filelist =~ s/ $//;
    $filelist =~ s/#/\\#/g;
    if ($filelist !~ /^[ \t]*$/) {
	open(lastcmd,'>.deleted/.lastcmd');
	print lastcmd $filelist,"\n";
	close(lastcmd);
	print `/bin/mv $startfiles$filelist .deleted$force`;
    }
    if ($olddir ne '.') {
	(chdir $pwd) || die "Can't get back to original directory $pwd: $!\n";
    }
}

while ($ARGV[0] =~ /^-/) {
    $_ = shift;
    /^-f/ && ($force = ' >/dev/null 2>&1');
    /^-i/ && ($interactive = 1);
    if (/^-+$/) {
	$startfiles = '- ';
	last;
    }
}

chop($pwd = `pwd`);

while ($file = shift) {
    if ($file =~ s|^(.*)/||) {
	$dir = $1;
    }
    else {
	$dir = '.';
    }

    if ($interactive) {
	print "vanish: remove $dir/$file? ";
	next unless <stdin> =~ /^y/i;
    }

    if ($file eq '.deleted') {
	print stderr "To delete .deleted (the trashcan) use the 'empty' command.\n";
	next;
    }

    if ($dir ne $olddir) {
	do it() if $olddir;
	$olddir = $dir;
    }

    $filelist .= $file; $filelist .= ' ';
}

do it() if $olddir;