Ticket #98 (accepted enhancement)

Opened 7 months ago

Last modified 6 months ago

feature request: directory “get size” option in contextual menu

Reported by: freeaks Owned by: TomPh
Priority: minor Component: main application
Version: 0.6.0 Severity: harmless
Keywords: Cc:

Description (last modified by TomPh) (diff)

add possibility to display a directory size (on demand, not automatic)
and display it in the file lister in place of the usual “4,096”

example:
i perform a right click on a directory, contextual menu appears,
from there i choose “get size” and the result gets displayed in the size column for that directory instead of the usual “4,096”.

tnx

Attachments

emelsizemockup.jpg (46.8 kB) – added by freeaks 6 months ago.

Change History

  Changed 6 months ago by TomPh

  • status changed from new to accepted
  • description modified (diff)

What size do you mean ?

follow-up: ↓ 3   Changed 6 months ago by freeaks

i made a mockup:


see the directory sizes? instead of “4.0k” ?
the idea is to have a button in the toolbar, and when you click it,
for all selected directories it calculate and show their size like this.

Changed 6 months ago by freeaks

in reply to: ↑ 2 ; follow-up: ↓ 4   Changed 6 months ago by freeaks

a button in toolbar like i said, or from contextual menu too ..
just on demand show directory size for all selected dirs..
afterward when you change path, say go to home (/home/freeaks/)
and then go back again to Projects (/home/freeaks/Projects/) all previously displayed size are gone (displaying just “4.0k” again..)
this is just a “on demand thing” to calculate and display directory size inline,
inside the lister.
each time you want to see the size of a given dir, select it and press toolbar button “get size”

see the directory sizes? instead of “4.0k” ?
the idea is to have a button in the toolbar, and when you click it,
for all selected directories it calculate and show their size like this.

in reply to: ↑ 3   Changed 6 months ago by freeaks

also while i’m at it,
i’d like to propose displaying “<dir>” instead of “4.0k” by default..

follow-up: ↓ 6   Changed 6 months ago by TomPh

The displayed size for a directory is the actual size allocated to the directory inode, on disk. For many systems, the size is a multiple of 4kB. Bigger sizes indicate more files in the directory, not that those files are themselves bigger.

Am I correct in thinking that the size you’re proposing to display is the summed size of all items in the directory?

If so, in general that’s very ‘costly’ to calculate, and would not be sensible to do regularly.

It would help if you could suggest some use-case(s) where such a total would be specifically insightful, and how so

in reply to: ↑ 5 ; follow-up: ↓ 7   Changed 6 months ago by freeaks

you tell me its costly ?
costly like what? costly how ?
i’m trying to explain to you its a “on demand” thing ! so it cost nothing unless you press the button….which will work only with selected directories, 1 time.

you *NEED* to press the button or else nothing happens ..

by default it does not calculate the size of dirs.
you have to select 1 or more directories, and press the “get size” button.
and only then something happens..
it’s requested by user, on selected dirs only and with button press only

in reply to: ↑ 6 ; follow-up: ↓ 8   Changed 6 months ago by freeaks

use cases ?
sure .. np:

say you want to copy directory “test123” to destination “/media/sdb2/”
but you don’t know how big is “test1234” and if there will be enough space in
destination “/media/sdb2/”

so you select directory “test1234”, then click on button “getsize” and see how big test1234 is ..

classic story really..

in reply to: ↑ 7   Changed 6 months ago by freeaks

another use case:

say, you suspect a given directory to have grown bigger than what it should, and you would like to confirm if this is true.

for example, a directory you want to burn on CD/DVD or copy on USB stick .. whatever ..

each time you need to know the size of one or more dictories, you just select them, and click “getsize” button to reveal their sizes ..

follow-up: ↓ 10   Changed 6 months ago by TomPh

Costly in the sense of recursive scanning of every file and subdirectory takes quite a bit of effort CPU and disk effort

That aside, a simple way to meet your need is for you to add another user-command to your filelist context menu, named say “_Get size”, with command du -bs %f, or du -bhs %f

in reply to: ↑ 9 ; follow-up: ↓ 11   Changed 6 months ago by freeaks

Costly in the sense of recursive scanning of every file and subdirectory
takes quite a bit of effort CPU and disk effort

it would be costly if this was a default / automated behavior.
but since this whole discution-idea is requesting user input and would
be a 1 time,
on demand, on selected dirs only,
it costs nothing imho.
( on demand: user have to press the button to calculate selected dir sizes )

That aside, a simple way to meet your need is for you to add another user-
command to your filelist context menu, named say “_Get size”, with command
du -bs %f, or du -bhs %f

the result would be displayed in the output panel right ?
the whole idea is to have the results displayed in line, in the
correct column (Size column)
for directories too … (only for selected dirs, 1 time, only when
user request it)
using output panel or terminal kills the point.

but anyway, i’m just suggesting a new feature here ..
if emelfm devs don’t understand its usefulness or simply don’t like
the idea, its fine by me ..
i’ll add it for myself eventually. or maybe not ..
its not very important .. its just a suggestion.

in reply to: ↑ 10   Changed 6 months ago by freeaks

still, i have the feeling that you don’t understand what i’m saying.
i made lots of detailled posts, i made a mockup ..
and yet you’re still speaking of cpu/time etc.. costs..
to be clear, what i’m suggesting is exactly the same thing as you said:

(on demand) “du -bhs %f”

the only difference with my idea is that it suggest to display the results in Size column instead of output panel. for clarity and corehence sake. why only files gets their sizes displayed and not dirs?

*****
i understand calculating automaticaly all dir sizes all the time would be bad. of course.
*****

BUT Not If it’s just on a few selected dirs, AND Only when user requests it.
do you understand the subtile difference i’m deseperatly trying to explain here?
i made maybe 10posts now, all saying the same, and you still reply to me about it being “costly” …

beside this, anyway,
as you can see on my mockup, i don’t use output panel at all.
(for that i just use a terminal when i need one)
i don’t like it when apps try to do too much…
i don’t like burning programs that have video player or music player integrated for ex..
when i need a filer i use a filer
when i need a term i use a term
so emelfm is a file manager, not a terminal, so i use it for.. guess what, file management 😉

sorry if i sound agressive or rude, this wasn’t the objective..
but try some coffee if you want to re-read all my posts,
the point i was trying to explain should jump in your eyes..
if you drink coffee before hand 😉

Note: See TracTickets for help on using tickets.