WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: du not taking files with same inodes into account (tcl 4.5.3)  (Read 2115 times)

Offline adrian

  • WikiUser
  • *
  • Posts: 31
Hi all,

I'd first like to say TCL is is AWESOME!!! But now, I'd like to report a failing.  :-[

The du utility isn't reporting space correctly.  A hard linked file should show up as not taking up so much space (only the size of the pointer to the inode).  Here is an example.

Code: [Select]
$ printf "% *s" $((1024*12)) '' > file1
$ cp -l file1 file2
$ ls -li file*
  14700 -rw-r--r--    2 backup   backup       12288 Jun  5 21:18 file1
  14700 -rw-r--r--    2 backup   backup       12288 Jun  5 21:18 file2
$ du -a file*
12.0K   file1
12.0K   file2

As you can see they are the same inode so I was expecting file1 to show up as 12.0K and file2 to be much less (around 1-4K) when using du.  Is there a quick fix for this? I need this to display overhead for a backup server that I'm making.

Thanks all,


A

P.S. Could someone fix the settings on this forum?  If I use the code tag, it says I am not allowed to post external links and keeps me from posting. :(

P.P.S. Looks like it is not enforced after the first post.
« Last Edit: June 05, 2012, 03:20:55 PM by adrian »

Offline adrian

  • WikiUser
  • *
  • Posts: 31
Re: du not taking files with same inodes into account (tcl 4.5.3)
« Reply #1 on: June 05, 2012, 03:19:18 PM »
Oh, FYI, I tried it on TCL 4.5.4 with the same bug.


A

Offline adrian

  • WikiUser
  • *
  • Posts: 31
Re: du not taking files with same inodes into account (tcl 4.5.3)
« Reply #2 on: June 05, 2012, 11:50:04 PM »
For now, I dled the gcc and support files and built the coreutils.  They all didn't compile, but they did compile up to compiling du so I'm happy about that.  I just need the du util anyway. :)


A

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10314
Re: du not taking files with same inodes into account (tcl 4.5.3)
« Reply #3 on: June 06, 2012, 02:12:38 AM »
Please report busybox bugs to busybox. Also there would have been coreutils.tcz ;)
The only barriers that can stop you are the ones you create yourself.

Offline adrian

  • WikiUser
  • *
  • Posts: 31
Re: du not taking files with same inodes into account (tcl 4.5.3)
« Reply #4 on: June 06, 2012, 12:34:23 PM »
Duh!  Done!  ;D


A