Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / Delete Directory - Isn't Safe

Author
Message
GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 8th Jan 2013 01:57 Edited at: 8th Jan 2013 01:58
The command delete directory is not supposed to delete a directory with files in it. Well it doesn't, but when I run it, it deletes all the files first, then the directory.

Attached is a zip with a project and a "Media" folder. The code is simple.



There is one file in the directory that is flagged as read only. It is "openscene.mid". After running the EXE, it is the only surviving file. If you remove the read only flag, it also disappears, and the folder as well since it is now empty.

I was using the delete directory recursively on my project folder to remove any empty folders (folders with files it it aren't deleted according to the help file), but the entire project folder is gone. Luckily, the project folder is located in my dropbox, so it was restored easily, but still...

DBP Compiler Version 1.0.0.5 (V1.05) (U77 RC7)
Tested on Windows 7 Pro 64, and Windows XP Pro 32

Edit: Media stolen from a 20-liner project I was just looking at. I needed fodder files, and that folder was already open.

Attachments

Login to view attachments
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Jan 2013 05:19
You know, there is a media folder in the DBP installation folder...

Keen to see if this bug report ever gets looked at, if it does, I would like to see the response...

But are you using delete file recursively too? just checking...

GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 8th Jan 2013 05:23
Quote: "But are you using delete file recursively too? just checking..."


I am not using delete file at all. I am only using delete directory, but it is deleting the contained files, which isn't its documented behavior.

My original project just called delete directory on a folder and each of its subfolders recursively, with the intent to only remove the empty folders, most likely left over for some reason or another. I am just glad the folder wasn't something really important.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Jan 2013 05:37
Just guessing here without testing, but maybe it checks for specific file types?

But yeah otherwise that would appears to be a needed fix, there is a top 3 bug fix thread thing on here for DBP, but I don't know...

Let's hope someone comes across this

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jan 2013 16:21
There's definitely a problem here.

The first time I tried this it deleted the files but not the folder, but now it deletes the folder as well.

Neither version is consistent with the Help file statement.

Login to post a reply

Server time is: 2024-03-29 12:02:49
Your offset time is: 2024-03-29 12:02:49