How to delete a directory?

Tim Rowledge tim at sumeru.stanford.edu
Tue Apr 9 01:23:58 UTC 2002


Jerome Chan <eviltofu at mac.com> is claimed by the authorities to have written:

> Given the full path, how do I delete a directory (simply)? Most of what I'
> ve gathered from FileDirectory is that I need to find the parent directory 
> and then ask it to delete the directory I want. Is there a simpler way?
This small changeset should solve your problem; it's a couple of methods
from the latest VMMaker.

(FileDirectory on: myPath) recursiveDelete

...should do it. To my surprise it seems very fast even when deleting a
large Squeak VM source code tree, so it will probably not need any
primitive support.

tim

-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- One clown short of a circus.

begin 644 FileDirectory.tpr.1.cs,ffd
M)T9R;VT at 4W%U96%K,RXR9V%M;6$@;V8@,34 at 2F%N=6%R>2`R,#`R(%ML871E
M<W0@=7!D871E.B`C-#@Q,5T@;VX at ."!!<')I;"`R,#`R(&%T(#4Z,C`Z,3(@
M<&TG(0T-(49I;&5$:7)E8W1O<GD@;65T:&]D<T9O<CH@)V9I;&4@;W!E<F%T
M:6]N<R<@<W1A;7`Z("=T<'(@,R\R-B\R,#`R(#$V.C0X)R$-9&5L971E3&]C
M86Q&:6QE<PT)(D1E;&5T92!T:&4@;&]C86P at 9FEL97,@:6X@=&AI<R!D:7)E
M8W1O<GDN(@T-"7-E;&8 at 9FEL94YA;65S(&1O.ELZ9FY\('-E;&8 at 9&5L971E
M1FEL94YA;65D.B!F;B!I9D%B<V5N=#H at 6RA#86YN;W1$96QE=&5&:6QE17AC
M97!T:6]N(&YE=PT)"0EM97-S86=E5&5X=#H@)T-O=6QD(&YO="!D96QE=&4@
M=&AE(&]L9"!V97)S:6]N(&]F(&9I;&4@)R`L("AS96QF(&9U;&Q.86UE1F]R
M.B!F;BDI('-I9VYA;%U=#2$@(0T-(49I;&5$:7)E8W1O<GD@;65T:&]D<T9O
M<CH@)V9I;&4@;W!E<F%T:6]N<R<@<W1A;7`Z("=T<'(@,R\R-B\R,#`R(#$X
M.C`Y)R$-<F5C=7)S:79E1&5L971E#0DB1&5L971E('1H92!T:&ES(&1I<F5C
M=&]R>2P@<F5C=7)S:6YG(&1O=VX@:71S('1R964N(@T)<V5L9B!D:7)E8W1O
M<GE.86UE<PT)"61O.B!;.F1N('P@*'-E;&8 at 9&ER96-T;W)Y3F%M960Z(&1N
M*2!R96-U<G-I=F5$96QE=&5=+ at T)<V5L9B!D96QE=&5,;V-A;$9I;&5S+ at T)
M(G-H;W5L9"!R96%L;'D at 8F4@<V]M92!E>&-E<'1I;VX@:&%N9&QI;F<@9F]R
M(&1I<F5C=&]R>2!D96QE=&EO;BP at 8G5T(&YO(`T)<W5P<&]R="!F;W(@:70@
M>65T(@T)<V5L9B!C;VYT86EN:6YG1&ER96-T;W)Y(&1E;&5T941I<F5C=&]R
6>3H@<V5L9B!L;V-A;$YA;64A("$-#6ER
`
end




More information about the Squeak-dev mailing list