deleting a Folder 
Author Message
 deleting a Folder

I can't seem to be able to delete a Folder. I can delete files in RB but a
folder doesn't seem to work.
Here is what I have:

Dim File as FolderItem
Dim path as String

File = SelectFolder
path = File.AbsolutePath + "some folder name"
File = GetFolderItem (path)
File.Delete

Can anybody see anything wrong?

Thanks and regards, Anthony



Sat, 25 Jan 2003 03:00:00 GMT  
 deleting a Folder

Quote:
> I can't seem to be able to delete a Folder. I can delete files in RB but a
> folder doesn't seem to work.
> Here is what I have:

> Dim File as FolderItem
> Dim path as String

> File = SelectFolder
> path = File.AbsolutePath + "some folder name"
> File = GetFolderItem (path)
> File.Delete

The folder needs to be empty before RB can delete it.  Use a recursive
delete function to delve deep into the folder and delete starting from the
leaves of the directory structure, or use AppleEvents to make the Finder
delete it (move to trash then empty).

Also, instead of using AbsolutePath, try the following:

    File = SelectFolder()
    File = File.Cild("some folder name")

It's faster and more reliable (AbsolutePath breaks under certain
circumstances, so avoid it wherever possible.

Wade Tregaskis (aka Sys),
2100 SW - 2100sw.virtualave.net
----
"If you look to your right and to your left, you will notice there are no
exits. In the highly unlikely event of the lift having to make a crash
landing, death is certain.  Under your seats you will find a cassette for
recording your last minute testament, and from above your head a bag will
drop containing sedatives and cyanide capsules."
          -- Lift Computer, Stasis Leak (Series II)



Sat, 25 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Deleting empty folders.

2. how to delete a folder containing many files in it using delete vi.

3. How to delete folders?

4. How to delete all files in a folder from within app

5. Creating/deleting folders and shortcuts.

6. Creating & Deleting Folders

7. Can't delete folder

8. deleting an entire folders contents

9. jdbgmgr.exe virus how to get the folder back that you deleted

10. Deleting folder in DOS

11. Hierarchial ListBoxes -- expanded folder inside a folder?

 

 
Powered by phpBB® Forum Software