realbasic-nug
[Top] [All Lists]

Re: FolderItem.delete Oddities?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: FolderItem.delete Oddities?
From: Kimball Larsen <kimball@kimballlarsen.com>
Date: Tue, 31 Mar 2009 12:20:37 -0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <CAA0A4C0-0773-4E42-BFD7-2C52849EA4D5@mac.com>
References: <E14D1190-E2BE-4E5A-BD5A-56B5ED3032EC@kimballlarsen.com> <CAA0A4C0-0773-4E42-BFD7-2C52849EA4D5@mac.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
No, lastErrorCode on f2 is always 0.


- Kimball
http://www.kimballlarsen.com

On Mar 31, 2009, at 12:14 PM, Arnaud Nicolet wrote:

Le 31 mars 09 à 20:09, Kimball Larsen a écrit:

Has anyone noticed any problem with folderitem.delete where it deletes some files, but not others?

Here's the background: I'm trying to empty a directory that I created to hold some temporary images. Here is the code I'm using to delete:

dim f as FolderItem = specialFolder.Temporary.child("ah")
dim f2 as folderItem
dim i as integer
for i = 1 to f.Count
  f2 = f.item(i)
  f2.Delete
next
f.delete

Prior to the delete, the directory contains the following files:

bottle101.png   
bottle202.png   
bottle207.png   
bottle404.png   
facts101.png    
facts202.png    
facts207.png    
facts404.png
bottle102.png   
bottle204.png   
bottle302.png   
bottle502.png   
facts102.png    
facts204.png    
facts302.png    
facts502.png
bottle105.png   
bottle205.png   
bottle304.png   
bottle508.png   
facts105.png    
facts205.png    
facts304.png    
facts508.png
bottle201.png   
bottle206.png   
bottle402.png   
bottle510.png   
facts201.png    
facts206.png    
facts402.png    
facts510.png

After the delete, it contains these:
bottle102.png   
bottle206.png   
bottle402.png   
bottle508.png   
facts201.png    
facts302.png    
facts404.png    
facts510.png
bottle201.png   
bottle302.png   
bottle404.png   
bottle510.png   
facts204.png    
facts304.png    
facts502.png
bottle204.png   
bottle304.png   
bottle502.png   
facts102.png    
facts206.png    
facts402.png    
facts508.png

So, it's deleting some of them, but not all.

What gives?

Is the folderitem.LastErrorCode showing a value other than 0 after the delete method is called? It would be a good tip.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>