Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/