How to delete a folder, file, everything.

1,125 views
Skip to first unread message

PK

unread,
Oct 18, 2014, 1:19:40 PM10/18/14
to mitappinv...@googlegroups.com
I searched for how to delete but found no topic on what I was looking for. The documentation says use the file component. The delete command is specific for a file. However i have found you may delete a folder by simply using "/folder". (this will delete off of sd card)

The delete command is not case sensitive. 
The folder MUST be empty or it will not delete. 


Files will delete the same way.

Not case sensitive.
Cannot use wildcards to delete all files. You must delete one at a time.

Work around without trying it yet would be to "while" files exist delete each file. when folder is empty delete folder.

If anyone know how to delete all files without one at a time love to know!

Thanks.

Abraham Getzler

unread,
Oct 18, 2014, 11:31:59 PM10/18/14
to mitappinv...@googlegroups.com
I've seen some nasty results on this forum when people lost projects
and the total contents of their Program Files directory during a de-install.

The de-install probably included a wild card file deletion,
similar to what you are requesting.

You can avoid contributing to such disasters by building a list
of all the names of the files you create, for use at cleanup time.

It don't take all that much code, and it makes your program safer
in the long run.

I personally regard the empty directory deletion restriction as
a very good safety feature, especially in a learner's tool like AI2.

ABG

PK

unread,
Oct 20, 2014, 1:24:46 PM10/20/14
to mitappinv...@googlegroups.com
Wildcad simply does not work. Looks like using tinydb may be the ticket or a list keeping track of the path names. Just figured out it is easier to just delete as the user takes the picture. No list needed.  Just parsed everything before the actual path. 


deletee.aia

Abraham Getzler

unread,
Oct 20, 2014, 1:59:15 PM10/20/14
to mitappinv...@googlegroups.com
I don't see in your screen shot where you assign a value to global NEWNAME.

ABG
 
Reply all
Reply to author
Forward
0 new messages