Samstag, 11. April 2009

hammerread.c ported to Linux

I ported hammerread.c to Linux. I was surprised how little I had to change in the source code. The Makefile contains the following switches:
# -D_BSD_SOURCE for DT_FIFO, DT_CHR .. in <dirent.h>
# -D_FILE_OFFSET_BITS=64 for large ino_t in <dirent.h>
# -D_XOPEN_SOURCE=500 for pread64 in <unistd.h>
You can test the application yourself. Grab a disk image from here: hammerdisk.raw.bz2. The contents of the image are:
$ find . -type f -ls
6400704 0 -rw-r--r-- 1 root wheel 12 Mar 23 20:04 ./test
12801152 0 -rw-r--r-- 1 root wheel 4 Apr 11 00:56 ./a/b/c/bar
Now download hammerread-0.1.tar.gz and use it as follows:

daniel@daniel-desktop:~$ wget http://hammerfs.googlepages.com/hammerread-0.1.tar.gz
daniel@daniel-desktop:~$ tar zxf hammerread-0.1.tar.gz
daniel@daniel-desktop:~$ cd hammerread
daniel@daniel-desktop:~/hammerread$ make
daniel@daniel-desktop:~/hammerread$ ./hammerread ../hammerdisk.raw
signature: valid
name: HAMMER
daniel@daniel-desktop:~/hammerread$ ./hammerread ../hammerdisk.raw /
signature: valid
name: HAMMER
/ 0/0 40755 0
test 8 10061aac0
a 4 1007a1650
daniel@daniel-desktop:~/hammerread$ ./hammerread ../hammerdisk.raw /test
signature: valid
name: HAMMER
/test 0/0 100644 12
Hello
World

1 Kommentare:

  1. I want to thank you for your work on this. I hope others will follow after you! I've already started to initiate interest in doing this on Slackware. I would appreciate if you could lend help here:
    http://www.linuxquestions.org/questions/slackware-14/im-looking-for-the-brave-who-could-manhandle-a-slackhammer-744248/

    Shingoshi

    AntwortenLöschen