[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Konqueror to inform about hard links?
From: Thiago Macieira <thiago () kde ! org>
Date: 2008-08-29 12:05:59
Message-ID: 200808291406.08127.thiago () kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Sexta 29 Agosto 2008 11:08:21 macintoshzoom wrote:
> John Tapsell wrote:
> >> BUT Konqueror was unable to tell me about that, this is an issue to me.
> >> When requesting Konqueror about used space (properties) of each folder
> >> it doesn't recognize that there are some GB of space that are not really
> >> occupied, but only are from the same file but hard linked to different
> >> subfolders.
> >
> > Yes, this is a bug that could be fixed. Keep a hash of the inodes
> > when checking the total used disk space.
>
> Could you tell me how I can "keep a hash of the inodes"? to try to
> implement a servicemenu or some script.
When the code is trying to calculate the disk space, it will stat(2) every
single file. From the inode of the file (st_inode in the stat structure), you
should keep a hash, like QSet<ino_t>.
in pseudo-code:
for each file
if (!set.contains(inode))
set.add(inode)
totalSize += size
(Note that size is the actual size occupied on disk, not the apparent file
size)
> >> My clue and idea:
> >> Konqueror, via a plugin or the like, or enabling this feature somewhere
> >> in a settings menu, could AT LEAST check for duplicate # inode numbered
> >> files and mark them with a specific icon, similar as the soft links or
> >> so.
> >
> > A simple icon for when the number of inodes is greater than 1 - should
> > be straightforward to do.
>
> I would like to do it, any clues?
I think it wouldn't be a good idea. What should a user do if he sees that
icon? What good would that possibly do?
I can imagine the bug reports: "I copied this file in Konqueror/Dolphin, so
they are identical. They have the same extension as well. But one shows a
different icon from the other. Why?"
>
> >> And tools as kwikdisk, kdiskfree, kdirstat and the like must also inform
> >> the user about this.
> >
> > Yes probably each of these could be fixed.
>
> I would like to do it, any clues?
My pseudo-code above. All tools that try to calculate disk space need to
understand the concept of inodes and notice when they cross filesystem
boundaries.
I have no idea what happens on union mounts....
> >> Question:
> >> If I delete one (from konqueror su) of this "duplicate hard linked"
> >> files, will I get back my free space
> >
> > No. The dialog box could warn the user of this, but it might be
> > difficult to present and explain this information in a friendly way.
>
> Yeeees, a dialog to inform about this!. To explain the info, yes, a bit
> difficult, but it must be done, its just a literature matter, perhaps
> showing also link-s to man:/ln or a custom help page or wiki page for
> this question.
No. That adds confusion.
"Are you sure you want to delete these files? Note that deleting them may not
free as much space as you expect."
What good would that do?
"The following files are hardlinked somewhere else. Deleting them will not
free up disk space. Are you sure you want to continue?"
What good would that do?
Also note that deleting files that have only *one* link may also not free up
disk space, for other reasons (for example, if the file is still open by any
application, by any user). So the warning above would completely miss those
files.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
["signature.asc" (application/pgp-signature)]
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic