What is the output format for Kyoto Cabinet `kchashmgr get` command?

316 Views Asked by At

Hello fellow Stackoverflowians.

I'm looking to extract information from a cache key from a Kyoto Tycoon cabinet file, specifically from the output from the Kyoto Cabinet utility kchashmgr (see: http://fallabs.com/kyotocabinet/util.html#kchashmgr )

I am trying to extract the expiration date from the output of the kchashmgr get from the binary/hexadecimal output.

kchashmgr get /path/to/kyto/tycoon/casket.kch cache_key

What is the output format of the above so from command-line shell utility I can do this:

expirationTimestamp=$(kchashmgr get /path/to/kyto/tycoon/casket.kch cache_key | something)

Initially I thought I could gunzip it (required ZLIB for it installation), but that obviously did not work. I also tried using the -px switch to see if that helped.

NOTE: I am looking for a shell solution that would, presumably, be faster than using a PHP script.

Thanks for your time on this subject.

P.S.

[yramirez@losthost ~ ]$ kcutilmgr conf -v  # version of Kyoto Cabinet
1.2.76
0

There are 0 best solutions below