<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>I should have mentioned that SHFileOperation will remove a folder AND its contents in one operation. There is no need to delete the folder's contents first. <BR>
Also, when setting the folders files to not read-only; this is done RECURSIVELY. <BR>
i.e. the folder's files, + the folder's child folders' files, + the folder's folders' folders' files etc..<BR>
&nbsp;<BR>
Depending on the flags used, this operation may NOT put the deleted folder into the recycle bin. So beware, it can instantly&nbsp;remove a large chunk of your disk if you get the folder path wrong ! <BR>
&nbsp;<BR>
Cheers,<BR>
Andy<BR><BR>
<BLOCKQUOTE>
<HR id=EC_stopSpelling>
From: amtween@hotmail.com<BR>To: squeak-dev@lists.squeakfoundation.org<BR>Date: Tue, 28 Aug 2007 20:28:01 +0100<BR>Subject: RE: directory recursive delete problem on Windows<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass P
{padding:0px;}
.ExternalClass
{font-size:10pt;font-family:Tahoma;}
</STYLE>
I have also seen this problem on Windows.<BR>&gt;From what I remember, disabling the windows indexing service + any virus checkers + Google desktop search, made it happen less often :)<BR>&nbsp;<BR>Also, it was more likely to occur when an explorer, viewing the folders contents, was open.<BR>And, from what I recall, it was made worse if the folder contained a .thumbs file and so it happened more often&nbsp;on XP than on Win2000.<BR>&nbsp;<BR>In the end we solved the problem by&nbsp;using the&nbsp;Shell.dll function - SHFileOperation -&nbsp;with the FO_DELETE , FOF_NOERRORUI, FOF_SILENT, FOF_NOCONFIRMATION flags; to do the folder delete. We also removed any read only, archive, flags from the files in the folder before calling the function).<BR>&nbsp;<BR>You could probably use FFI to call the function, or else make a plugin.<BR>Cheers,<BR>Andy<BR><BR>.<BR><BR><BR>
<HR id=EC_stopSpelling>
<BR>&gt; Date: Tue, 28 Aug 2007 19:20:54 +0200<BR>&gt; From: michael@impara.de<BR>&gt; To: squeak-dev@lists.squeakfoundation.org<BR>&gt; Subject: directory recursive delete problem on Windows<BR>&gt; <BR>&gt; Hi all,<BR>&gt; <BR>&gt; Grit just ran into an -interesting to say the least- problem with <BR>&gt; recursive deletion of directories on Windows. We are not able to provide <BR>&gt; a stripped down test case yet, but here some info:<BR>&gt; <BR>&gt; - we extract a zip archive to provide an initial setup for Plopp data<BR>&gt; - then the user can play around in demo mode (problem doesn't occur in a <BR>&gt; full version as the deletion doesn't take place)<BR>&gt; - upon quitting demo mode all data is erased via a recursive directory <BR>&gt; delete<BR>&gt; <BR>&gt; <BR>&gt; We have simple test up without running the UI to reproduce the problem.<BR>&gt; <BR>&gt; The delete fails about 1 in 10 with a primitive failed in deleteDirectory.<BR>&gt; <BR>&gt; There are no open files or anything obvious.<BR>&gt; <BR>&gt; Now the interesting part...<BR>&gt; If we add a delay of 1 sec after catching the error and then simply <BR>&gt; retry the exception to delete the directory again, it works.<BR>&gt; <BR>&gt; [Painter3DStorage storageDirectory recursiveDelete]<BR>&gt; on: Error<BR>&gt; do: [: exception |<BR>&gt; (Delay forMilliseconds: 1000) wait.<BR>&gt; exeption retry]<BR>&gt; <BR>&gt; Any ideas?<BR>&gt; <BR>&gt; Michael<BR>&gt; <BR>&gt; <BR>&gt; <BR><BR><BR>
<HR>
Email straight to your blog, upload jokes, photos and more. <A href="http://specials.uk.msn.com/spaces/default.aspx" target=_blank>Windows Live Spaces, it's FREE!</A> </BLOCKQUOTE><br /><hr />Are you the Quizmaster?  <a href='http://specials.uk.msn.com/brainbattle' target='_new'>Play BrainBattle with a friend now! </a></body>
</html>