Opened 13 years ago

Closed 11 years ago

Last modified 10 years ago

#1212 closed Enhancement (invalid)

Free space

Reported by: Vabavia Owned by:
Priority: Normal Milestone: None Set
Component: libtransmission Version: 1.32
Severity: Normal Keywords: needs-patch
Cc:

Description

It will be very usefull to see how math free space left on current drive, when I adding an torrent download. Sorry for my English.

Attachments (4)

freespace.c (3.5 KB) - added by charles 13 years ago.
here's how php does this portably
transmission-quota_or_diskfree.patch (9.5 KB) - added by Elbandi 12 years ago.
transmisson-diskstatus.diff (5.2 KB) - added by Elbandi 12 years ago.
checkspace-upstream.patch (5.2 KB) - added by Elbandi 12 years ago.

Download all attachments as: .zip

Change History (33)

comment:1 Changed 13 years ago by livings124

  • Resolution set to wontfix
  • Status changed from new to closed

The OS can show you this information - adding it else where is a bit bloaty.

comment:2 Changed 13 years ago by mezz

I agree about OS can show you the info, but since Transmission now included daemon/web stuff. I think it will be useful to have this feature, that way one of us can tell how much space left before add torrent in WebUI. :-)

comment:3 Changed 13 years ago by elagon

I agree with mezz, with remote interfaces this could be very usefull

comment:4 Changed 13 years ago by theCrank

  • Component changed from Transmission to Web Client
  • Resolution wontfix deleted
  • Status changed from closed to reopened

I agree with mezz and elagon. The WebUI could use such a feature, you can't always access your server and check your free space (no ssh-client available, ...). I'm not thinking about a mechanism that stops me from adding new torrents, when the disk is nearly full, but only a small hint that warns me, somewhere in the "add torrent" window.

Changed 13 years ago by charles

here's how php does this portably

comment:5 Changed 12 years ago by Elbandi

We use OS quota for limit the disk space. So i made a little patch: daemon can query the current quota status. if there is no quota or query failed, fallback to diskspace (use statvfs like php). The web interface have a new a bar: displays the current disk/quota usage, soft and hard usage (if diskspace used, soft = hard).

Changed 12 years ago by Elbandi

comment:6 follow-up: Changed 12 years ago by charles

Elbandi: what platforms does that work for?

comment:7 in reply to: ↑ 6 Changed 12 years ago by Elbandi

charles: i use ubuntu. but every linux have quotactl, statvfs and i think setmntent/getmntent/endmntent calls. And maybe the /etc/mtab file is standard. (or /proc/mounts). But i dont know about OSX or BSD :(

comment:8 Changed 12 years ago by mezz

The *BSDs, OS X and Windows don't have /etc/mtab and /proc/mounts, so this patch won't work for these OSs. I actually don't mind you to use this patch if you add some option in build time like enable this feature only on Linux and not other OSs until one of OS port it.

comment:9 Changed 12 years ago by Elbandi

In windows i can get the diskspace with GetDiskFreeSpaceEx call. But i havent got bsd or osx.

Where can i find some info, how to build transmission in windows?

comment:10 Changed 12 years ago by charles

Elbandi: the best person to ask is the person doing the "wintransmisson" project. You can find him here.

comment:11 Changed 12 years ago by Elbandi

i implement the windows version to get the disk free size. The query function is in platform.c . But i dont know what sould i check in other systems (osx, bsd): #define ????

Changed 12 years ago by Elbandi

comment:12 Changed 12 years ago by Elbandi

updated the diff to 1.50 beta1

comment:13 Changed 12 years ago by charles

Is it really necessary to have all these eight fields? Unless I'm misunderstanding something we really only need to know how much free space is available for use on the disk, and that's just a single field. It's also a simpler & more portable goal than the code in the current patch.

Elbandi: any chance of revising this patch to make it simpler?

comment:14 follow-up: Changed 12 years ago by Elbandi

The "freespace" would be good for a single system (desktop, homerouter), because only one ppl use the disk. And in most cases with gui, and look to disk his disk space.
But the transmission daemon (and the rpc interface) is used in a dedicated server with many users. A good supervisor (like me ;] ) setup quota for this users to prevent to one user eat all disk space... In linux system the diskspace != quota space. So in my solution first query the quota status. If no quota, or query is failed, "fallback" to get diskspace. There is easier in windows, because diskspace == disk quota. (i havent got access to bsd* or osx, so i cant test on that system).

comment:15 Changed 12 years ago by turbo

This information/code is also in the #920 patch(es)... Haven't looked at patches in this ticket to see which is best though.

comment:16 in reply to: ↑ 14 Changed 12 years ago by charles

Replying to Elbandi:

The "freespace" would be good for a single system (desktop, homerouter), because only one ppl use the disk. And in most cases with gui, and look to disk his disk space.
But the transmission daemon (and the rpc interface) is used in a dedicated server with many users. A good supervisor (like me ;] ) setup quota for this users to prevent to one user eat all disk space... In linux system the diskspace != quota space. So in my solution first query the quota status. If no quota, or query is failed, "fallback" to get diskspace. There is easier in windows, because diskspace == disk quota. (i havent got access to bsd* or osx, so i cant test on that system).

Well, let me put it a different way then... all Transmission really cares about is how much space the user has left that they can use. No matter how we derive that value under the covers, surely that's the only field that needs to be returned back to the RPC clients...

comment:17 Changed 12 years ago by charles

Elbandi: any chance of revising this patch to make it simpler?

comment:18 Changed 12 years ago by charles

Elbandi: ping

comment:19 Changed 12 years ago by charles

  • Resolution set to wontfix
  • Status changed from reopened to closed

Closing this ticket due to lack of interest.

I'd still welcome a patch along the line described in the previous couple of comments. If someone wants to write such a patch, feel free to reopen this ticket....

comment:20 Changed 12 years ago by charles

  • Keywords needs-patch added

comment:21 Changed 12 years ago by Elbandi

After torrents are having moved anywhere with setlocation, i see no reason to finish this :(

If someone doesnt use setlocation (or disable it), use the patch in this ticket to own build.

comment:22 Changed 12 years ago by elagon

Maybe transmission could check the free space of the setlocation destination...

comment:23 Changed 12 years ago by Elbandi

  • Component changed from Web Client to libtransmission
  • Resolution wontfix deleted
  • Status changed from closed to reopened

hmm, this setlocation checking is a good idea. i made a patch (based my old code), to check the new location, is space for the torrent. If force (boolean) is set true, no checking.

Changed 12 years ago by Elbandi

comment:24 Changed 11 years ago by charles

  • Resolution set to invalid
  • Status changed from reopened to closed

seven months have gone by and nobody else has asked for this feature, and there's no consensus on how it should be implemented in the first place.

I'm going to close this ticket as wontfix for now... it seems to be a solution in search of a problem. Maybe this will be needed in the web ui rewrite but for now we don't seem to need it.

comment:25 Changed 11 years ago by lkraav

as a side note, this is how i implemented functionality in question, but it depends on an external cron job to supply the info. i'd say it's definitely useful, but i don't have a good idea how to do it in a simple x-platform way without external deps.

comment:26 Changed 11 years ago by charles

  • Resolution invalid deleted
  • Status changed from closed to reopened

Ticket #2990 has been closed as a duplicate of this ticket.

If someone were to submit a simple, clean and portable patch to implement this, I would use it. The reason I didn't use Elbandi's patch for this was because it failed all three critiera. :(

comment:27 Changed 11 years ago by charles

Ticket #3236 has been closed as a duplicate of this ticket.

comment:28 follow-up: Changed 11 years ago by charles

  • Resolution set to invalid
  • Status changed from reopened to closed

seven more months have gone by with no new interest in this feature.

I'm going to close this ticket as wontfix for now... it seems to be a solution in search of a problem. Maybe this will be needed in the web ui rewrite but for now we don't seem to need it.

comment:29 in reply to: ↑ 28 Changed 10 years ago by Opperpanter

Replying to charles:

seven more months have gone by with no new interest in this feature.

I'm going to close this ticket as wontfix for now... it seems to be a solution in search of >a problem. Maybe this will be needed in the web ui rewrite but for now we don't seem to need >it.

Isn't this being tracked in #1212 at the moment? From that one it's clearly a desired feature. Lots of times I add torrents from work or holiday location (on my server at home) and need an indication of how much space is left.

Note: See TracTickets for help on using tickets.