[comp.unix.xenix] ENORMOUS pathname

stefan@spcc386.UUCP (Stefan Posthuma) (02/02/90)

Hi there,

A directory-handling program went berzerk and now I have this path with
about two hundred directories in there. I have tried but there seems to be
no way to get rid of it. The shell breaks when I go deep enough, rm -r goofs
up, fsck fails, rmdir crashes and so on.
I am running SCO Xenix 386 2.3.1

Bright ideas anyone?
-- 
--------------------------------------------------------------------------------
  "Oh my God, it is the attack of the Half-Crazed Mutant Teenage Alien Computer
Junkies!!"                                 +------------------------------------
  "Relax! It are just some SPCC employees" | uunet!mcvax!spcc386!stefan

pcg@rupert.cs.aber.ac.uk (Piercarlo Grandi) (02/06/90)

In article <350@spcc386.UUCP> stefan@spcc386.UUCP (Stefan Posthuma) writes:

   A directory-handling program went berzerk and now I have this path with
   about two hundred directories in there. I have tried but there seems to be
   no way to get rid of it. The shell breaks when I go deep enough, rm -r goofs
   up, fsck fails, rmdir crashes and so on.
   I am running SCO Xenix 386 2.3.1

   Bright ideas anyone?

Fairly easy... move everything else our of that directory, or
move the first part of the crazy pathname into its own directory,
and then use fsdb and ZAP THE INODE (keep zapping inodes...).
Ignore fsck's attempts to rescue the directory then.

Or use ftw(3) with a routine that does an unlink(2) from the
bottom up.
--
Piercarlo "Peter" Grandi           | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcvax!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk

edhew@xenitec.on.ca (Ed Hew) (02/07/90)

In article <350@spcc386.UUCP> stefan@spcc386.UUCP (Stefan Posthuma) writes:
>Hi there,
>
>A directory-handling program went berzerk and now I have this path with
>about two hundred directories in there. I have tried but there seems to be
>no way to get rid of it. The shell breaks when I go deep enough, rm -r goofs
>up, fsck fails, rmdir crashes and so on.
>I am running SCO Xenix 386 2.3.1
>
>Bright ideas anyone?

Unless I'm missing something totally obvious here, the (RTFM) answer
is under find(c)

	cd bad_dir;find . -name "*" -exec rm {} \;

That can be simplified.
(rm can of course be replaced by any applicable valid command.)

> uunet!mcvax!spcc386!stefan

  Ed. A. Hew         SCO Authorized Instructor         Xeni/Con Corporation
  work:  edhew@xenicon.uucp	 -or-	 ..!{uunet!}utai!lsuc!xenicon!edhew
->home:	 edhew@xenitec.on.ca	 -or-	   ..!{uunet!}watmath!xenitec!edhew