[ATTENTION], "problem" with FolderItem.Exists

jda jda at his.com
Mon Feb 21 06:43:58 CST 2005


>I wonder what the rest of the code is. This code doesn't seem to do 
>anything as far as RB is concerned. The end result is the same and 
>on one folderitem is created just like the first bit of code. I'm 
>just wondering if this is really a bug in RB or just an abuse of 
>folderitem in some way.
>

Kevin, I have no idea how one can abuse a folderItem. I certainly 
deny I have ever done it. And rumors to the contrary are not 
sufficient to convict. At least not again.

There is a bug in RB that causes problems in the following scenario:

1. Use GetSaveFolderItem to make a folderItem (f) -- it must replace 
an existing file
2. db.Create(f...)
3. f points to the file, but f.exists = false (incorrect).
4. trouble ensues

Ruslan has found a workaround, which he posted. A safer alternative 
to reeestablishing the folderItem is:

f = f.parent.child(f.name)

(used immediately after db.Create)

Now f.exists = true

Sooner or later most folks will run into this bug. If you find a 
better workaround, let us know.

Jon


More information about the Valentina-beta mailing list