Deleting Files

169 views
Skip to first unread message

Slippy

unread,
Jun 23, 2011, 10:18:13 AM6/23/11
to OOO Libs
Hello there,

i've one question:
How can I delete files, which were downloaded by getdown?
I thought, if I remove a file from the "getdown.txt", then it will be
removed by the clients too.

Greetings,
Slippy

Michael Bayne

unread,
Jun 23, 2011, 12:02:34 PM6/23/11
to OOO Libs
On Thu, 23 Jun 2011, Slippy wrote:

> i've one question: How can I delete files, which were downloaded by
> getdown? I thought, if I remove a file from the "getdown.txt", then it
> will be removed by the clients too.

There's no good way for Getdown to know what files in the directory used
to be part of a Getdown distribution but no longer are.

If it used a heuristic, that heuristic might be wrong and we might end up
deleting some critical file from someone's application, which would
obviously be very bad.

So you have to add code to your application to delete obsolete files if
you want them deleted.

-- m...@threerings.net

Slippy

unread,
Jun 24, 2011, 2:45:18 AM6/24/11
to OOO Libs
Hello,

oh okay. That's too bad.
So I have to delete all files, where no counterpart with the name
"filename.fileending"+v exists? Or is there something else I have to
notice?

By the way, thanks for the fast answer :).

Michael Bayne

unread,
Jun 24, 2011, 2:02:45 PM6/24/11
to OOO Libs
On Thu, 23 Jun 2011, Slippy wrote:

> So I have to delete all files, where no counterpart with the name
> "filename.fileending"+v exists? Or is there something else I have to
> notice?

Well, since you're writing the application, you would know when you remove
a file from your Getdown distribution. I'd suggest adding that file to a
list inside your application, and when your app runs, it can go through
the list and ensure that all files on it are deleted.

If you just go deleting every file that doesn't have a "file"v
correspondant, you're going to break things just as badly as Getdown would
if it tried to use that heuristic.

The getdown.txt file has no v version, nor digest.txt, nor any of the log
files, nor the generated proxy.txt or version.txt (for versioned apps)
files. Nor the gettingdown.lock file. Nor any other files placed into your
app's directory by your installer.

You could generate a list of files *not* to delete, but then that won't
help you if Getdown decides to introduce a new control file for some
reason. Your app would delete that file and probably break Getdown.

Just keeping track of the files that you retired from your app would be
safest.

A thought occurs to me. We could add support to Getdown for doing this
cleaning, as long as it remained explicit. For example, if you had a
getdown file that looked like:


...
code = foo.jar
code = bar.jar
resource = foobar.jar
...

and you decided you no longer needed foobar.jar, we could allow you to
change your getdown.txt file thusly:

...
code = foo.jar
code = bar.jar
delete = foobar.jar
...

and Getdown would take care of deleting the retired resource.

This way you don't have to add anything to your application, and Getdown
knows that you want the file in question deleted, so it can safely do so.

-- m...@threerings.net

Slippy

unread,
Jun 27, 2011, 3:09:46 AM6/27/11
to OOO Libs
Hello,

the idea sounds good to me :).
Because if you want to delete a file, it is in the getdown.txt anyway,
because previously it was in the getdown.txt as code or resource. In
this way it is easier to maintain the application or the installation
process because we have only one word in the txt to replace.

Timothy Minahan

unread,
Sep 25, 2014, 1:56:45 AM9/25/14
to ooo-...@googlegroups.com, slipp...@googlemail.com
Hi All,

Sorry to necro the thread but was this ever implemented?

--TLM

Timothy Minahan

unread,
Sep 25, 2014, 9:08:22 PM9/25/14
to ooo-...@googlegroups.com, slipp...@googlemail.com
Looking at the code there is a Resource.erase() method but I cant see anywhere that is being called or processed...

Michael Bayne

unread,
Sep 26, 2014, 9:55:56 AM9/26/14
to ooo-...@googlegroups.com, Markus Cramer
On Wed, Sep 24, 2014 at 10:56 PM, Timothy Minahan <tim...@minahan.net> wrote:
Sorry to necro the thread but was this ever implemented?

Nope! It wouldn't be too hard though, if you want to take a crack at it and send a pull request.

-- m...@samskivert.com

Michael Bayne

unread,
Sep 26, 2014, 2:09:33 PM9/26/14
to ooo-...@googlegroups.com, Markus Cramer
On Thu, Sep 25, 2014 at 6:08 PM, Timothy Minahan <tim...@minahan.net> wrote:
Looking at the code there is a Resource.erase() method but I cant see anywhere that is being called or processed...

Yeah, that dates back to the original implementation. I probably added it because I thought resources might need to be erased for some reason, and then never deleted it after discovering it was unused.

It would likely turn out to be useful in implementing 'delete = file' support, but beware code that was written ten years ago and never used!

-- m...@samskivert.com

Tomáš Růžička

unread,
Jan 22, 2019, 4:24:51 PM1/22/19
to OOO Libs
Hi,
was there any progress? Would it be possible to add ability to delete files/folders with param "delete / deleteFile / deleteFolder"? Because if we deploy several setup folders like db1,db2,db3 and then we decide to use only db1 and db3 we want to clean the mess (preferably with getdown because app already uses that dirs when it starts).

Thank you for your answer.

Dne pátek 26. září 2014 20:09:33 UTC+2 Michael Bayne napsal(a):

Michael Bayne

unread,
Jan 22, 2019, 4:36:54 PM1/22/19
to ooo-...@googlegroups.com
No pull requests have come down the pipe, so no progress. I personally still think it's better for the app itself to clean up files and folders that it knows it no longer needs. That way one knows the code that no longer needs the old directories is actually running on the user's machine.

--
You received this message because you are subscribed to the Google Groups "OOO Libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ooo-libs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Tomáš Růžička

unread,
Jan 22, 2019, 4:45:19 PM1/22/19
to OOO Libs
I got the point. It¨s just another feature that somebody can use while others won't use.

Actually I would use it for app. Like local sys admins can deploy more content for users without changing main app and then they could delete them once it's over.

Dne úterý 22. ledna 2019 22:36:54 UTC+1 Michael Bayne napsal(a):

Michael Bayne

unread,
Jan 22, 2019, 5:17:43 PM1/22/19
to ooo-...@googlegroups.com
On Tue, Jan 22, 2019 at 1:45 PM Tomáš Růžička <rrru...@gmail.com> wrote:
I got the point. It¨s just another feature that somebody can use while others won't use.

Actually I would use it for app. Like local sys admins can deploy more content for users without changing main app and then they could delete them once it's over.

I'm not saying it's a bad idea, just that no one has submitted a pull request for it. I'm already donating my time to review and merge pull requests and to generally keep the Getdown project going, out of the goodness of my heart. I'm not going to just start implementing arbitrary feature requests too.


Tomáš Růžička

unread,
Jan 23, 2019, 1:51:58 AM1/23/19
to OOO Libs
Sorry. It was not meant wrong :) I appreciate your work. It was just an idea.

Thank you

Dne úterý 22. ledna 2019 23:17:43 UTC+1 Michael Bayne napsal(a):

Daniel Gredler (DHLeC)

unread,
Jan 23, 2019, 9:56:50 AM1/23/19
to ooo-...@googlegroups.com

Hi Tomas,

 

Speaking from experience, the process of getting a pull request incorporated into the mainline code is not too painful, assuming the idea and the implementation are good. If you have an idea for a new feature, I would encourage you to flesh out the details on the mailing list and then submit a pull request. It’s not too hard, you’ll be creating value for yourself, and you’ll be creating value for others as well. Scratch that itch!

 

Take care,

 

Daniel

--

Reply all
Reply to author
Forward
0 new messages