aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: [1] 2

Author Topic: Close file descriptor for stopped file  (Read 9200 times)

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Close file descriptor for stopped file
« on: August 17, 2008, 08:55:09 AM »

Can aMule close the file handle for stopped files?

For two reasons: one is the obvious: running out of file handles.

But less obvious is to be able to recover a file: you start the file again, wait for it to get the hashes. Stop the file, replace the .part with the real data, and restart it (and request a manual rehash - see my other feature request).
« Last Edit: August 22, 2008, 11:30:31 PM by asamule »
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Close file description for stopped file
« Reply #1 on: August 17, 2008, 11:46:25 AM »

Stopped file can still upload...
Logged
concordia cum veritate

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Re: Close file description for stopped file
« Reply #2 on: August 17, 2008, 06:20:46 PM »

Ah! Oops, forgot about that.

Cancel this request, but....

I would like a way to completely stop (freeze) a file, doesn't upload doesn't download, doesn't notify servers or respond to kad, but I guess that's a separate request, and not related to this one. (Actually I wanted it anyway, separate from this one, but hadn't posted it.)

To do that now, you have to stop aMule, and move the partfile away. But I prefer not to stop aMule as much as possible.
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Close file description for stopped file
« Reply #3 on: August 18, 2008, 10:48:33 AM »

No need to stop aMule. Move the file and reload the shares.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Close file description for stopped file
« Reply #4 on: August 18, 2008, 03:34:15 PM »

No need to stop aMule. Move the file and reload the shares.
He means an incomplete file (part file), not a completed file from the shares. I doubt you can move that away, and even if you do it (after stopping aMule), the number gets reused sooner or later.
What about suspending upload (and publishing) for stopped files ? So they would sit there completely passive, just holding their numberreserved. (Manual rehash is a different issue - for this use case there is an extra entry in the context menu required. It makes no sense to do it on every resume.)
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Close file description for stopped file
« Reply #5 on: August 18, 2008, 04:07:02 PM »

What about suspending upload (and publishing) for stopped files ?

I am curious as to why you think people sharing less files is a good idea.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Close file description for stopped file
« Reply #6 on: August 18, 2008, 06:38:37 PM »

It's called "giving the user options". Why shouldn't a user be allowed to stop a transfer good and full in both directions, and resume it later ? To keep other files uploading meanwhile and get the credits for them ?
There are no downloads for the stopped file, so it's not leeching. aMule doesn't share the whole disk and allows being closed - both also causes "people sharing less files".  ;)
I always wondered if the difference between "paused" and "stopped" (just dropping the sources) is really worth making two states. Leaving "paused" as it is and making "stopped" a full stop makes more sense imho. Also, it would fulfill asamule's original request, which is a good idea.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Close file description for stopped file
« Reply #7 on: August 19, 2008, 03:27:41 AM »

Ok, I see now what asamule wants, but I still see no advantage in doing it, unless he wants to save the file in another file system. If it is stopped, it might still upload as Gonosztopi has very well remembered, and the more you share, more probable it is that you give, what is good for you. Not to mention that moving an incomplete file to another file system might give you some bad surprises, I don't know what happens to a sparse file when copied, it will probably be filled with zeroes or worst. Imagine a 4 GByte file with just the first and last chunks...

As to the file handle problem, I have previously donwloaded like 800 files simultaneously to stress aMule, and never got out of file handles. Is that a system wide limitation or a per process limitation? And exactly what is the limit? 1024 files?
« Last Edit: August 19, 2008, 03:32:42 AM by phoenix »
Logged

ecforum

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 105
Re: Close file description for stopped file
« Reply #8 on: August 19, 2008, 11:01:44 PM »

Why shouldn't a user be allowed to stop a transfer good and full in both directions, and resume it later ? To keep other files uploading meanwhile and get the credits for them ?
Hello,

You can do that using the priority of the shared files : set a very low priority for the upload you want to stop. Set higher priority for other files. And release priority for files on which you quickly want credits.
It is working very well : you can see the new order of the clients in the queue by sorting it by "score".
Logged

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Re: Close file description for stopped file
« Reply #9 on: August 22, 2008, 10:21:15 PM »

I am curious as to why you think people sharing less files is a good idea.
It's a file that is incomplete for years already. I'm tired of uploading it, I think I have a ratio of over 20 for that file. Plenty of people have it, and usually people will download it from me (whatever's available), then realize it's incomplete and delete it - it's a total waste. Everyone who is serious about the file has all of it already, there is no need to upload anymore.

I want to stop it totally, and every few weeks start it up to see if anyone has new pieces. Probably that will never happen, but I have seen it complete a couple of times, but the person never uploads anything. Yes I know this might mean I will miss him.

I have specific files that I keep available for upload, and I want them to use any upload bandwidth available. I set this file to very low priority, but it does still upload eventually.

Reason #2:

If I'm hard linking (rare) files between aMule and a torrent, I need amule to close the file handle so I can replace the part file from under it with a hard link to a different file. I know this is not a common usage pattern. My only other method is to stop aMule, and restart it.

Reason #3:

I have an incomplete file from elsewhere. I want to start a download, stop it, replace the file with the incomplete one and continue. The other option is to copy the data over the file, then do a manual rehash (if that feature is made), or to import the data into the file (if that feature is made). But simply replacing the file uses the least IO.
« Last Edit: August 22, 2008, 10:25:58 PM by asamule »
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Close file description for stopped file
« Reply #10 on: August 22, 2008, 10:51:41 PM »

I want to stop it totally, and every few weeks start it up to see if anyone has new pieces.

You also want to prevent anyone from being able to do that. Not only that, but you will also not upload the already available parts to a hypothetic person that wants the full file, whch can lead to the hilarious situation of a new downloader downloading parts that you already have from the complete source, preventing you AND him to download the file.

Reason 2 is wrong reasoning all around.

Reason 3 makes no sense. Close amule, replace the .part with the data, touch the met file, reopen aMule. That simple.
Logged

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Re: Close file description for stopped file
« Reply #11 on: August 22, 2008, 11:26:19 PM »

I want to stop it totally, and every few weeks start it up to see if anyone has new pieces.

You also want to prevent anyone from being able to do that. Not only that, but you will also not upload the already available parts to a hypothetic person that wants the full file, whch can lead to the hilarious situation of a new downloader downloading parts that you already have from the complete source, preventing you AND him to download the file.

I know that's a risk. And I don't care. It's been years. I'm probably just going to move the part file away, and put it back for a bit every once in a while. But I'd really prefer not to.

Quote
Reason 2 is wrong reasoning all around.
How so? I've rescued both torrent and ed2k files by bridging the two networks, and a hard link is the easiest way to do that.
Quote
Reason 3 makes no sense. Close amule, replace the .part with the data, touch the met file, reopen aMule. That simple.
I know I can do that - I wrote the code that does that! But I don't want to stop aMule, that's all.
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Close file descriptor for stopped file
« Reply #12 on: August 23, 2008, 12:59:41 AM »

I want to stop it totally, and every few weeks start it up to see if anyone has new pieces.

You also want to prevent anyone from being able to do that. Not only that, but you will also not upload the already available parts to a hypothetic person that wants the full file, whch can lead to the hilarious situation of a new downloader downloading parts that you already have from the complete source, preventing you AND him to download the file.

I know that's a risk. And I don't care.

And I do.
Logged

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Re: Close file descriptor for stopped file
« Reply #13 on: August 23, 2008, 01:18:20 AM »

And I do.

I understand, if people did that too much it would be bad. But how is it worse then me canceling or moving the part file away? Or simply closing aMule? All those things have the same effect.

As for other arguments, my example is unusual, most people will want to stop a file for simpler reasons. Although the only one I can think of is that they have more important things to upload.

Perhaps an idle priority? Meaning upload the file only when nothing else is using the bandwidth? (i.e. there is an open slot). And limit idle to stopped (and completed) files? (BTW: If that were a feature for completed files, I'd leave more of them in my shared folder. I move them away once I'm over ratio of 1 because they hurt upload credits for new files I'm downloading, and I don't usually remember to move them back.)

There are two reasons for what I want here: not wasting upload, which we are talking about.

And closing the file handle so that I can replace the file. I guess this second one is a lost cause, although I actually want it more than the upload reason, it's probably not useful for enough people.
« Last Edit: August 23, 2008, 01:21:42 AM by asamule »
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Close file descriptor for stopped file
« Reply #14 on: August 23, 2008, 02:01:22 AM »

You're never wasting upload. You upload always things other people want.
Logged
Pages: [1] 2