delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/21/13:26:58

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Eric Hanchrow <offby1 AT blarg DOT net>
Subject: Re: How to delete rogue nul files
Date: Wed, 21 Jul 2004 10:26:41 -0700
Lines: 30
Message-ID: <87smblfezy.fsf@offby1.atm01.sea.blarg.net>
References: <gd5tf09ne640a4hbd1gqracolb3u45jks7 AT 4ax DOT com>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: offby1.atm01.sea.blarg.net
User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)
X-IsSubscribed: yes

I've been using this:

    #!/usr/bin/env perl

    use warnings;
    use strict;
    use Data::Dumper;

    die "This program is only useful on Cygwin.\n"
      unless ($^O eq "cygwin");

    my $filename = shift;

    $filename =~ s(/nul$)()i;

    $filename = qx(realpath $filename);     chomp $filename;
    $filename = qx(cygpath -w $filename);   chomp $filename;
    $filename = q(\\\\.\\) . $filename;
    $filename .= "\\nul";

    if (unlink $filename) {
      print "Removed $filename.\n";
    } else {
      warn "Can't unlink $filename: $!";
    }

-- 
A DRE voting system is one of the simplest computer
applications you could imagine.  It just adds by one.
        -- Brit Williams, emeritus professor of computer science


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019