Re: Dumb Question No. 1.

From: Cord Beermann <>
Date: Mon, 9 Jun 1997 09:13:28 +0200 (MET DST)

Hallo! Du (Robert Thomas) hast geschrieben:

>This has been asked, and answered before, but, as I never needed to know
>this before, I never took any notice of it.

For old articles you should look at the Squid-users-archive and the
searchable squid-users archive. You can find pointers to them on

> Could someone please
>explain to me how I can extrapolate a squidlog entry, eg,
>0008afcc 3395a273 fffffffe 3156dd6d 294510
>into an actual location on disk?

I began to write a perl script which (hopefully) do this:

sub cachefile_to_object {
    my $cachefile = hex(shift(@_));
    my $swaplevel1dirs = shift(@_);
    my $swaplevel2dirs = shift(@_);
    my @cachedir = @_;
    return sprintf ("%s/%02X/%02X/%08X",
                    $cachedir[$cachefile % ($#cachedir + 1)],
                    ($cachefile / ($#cachedir + 1)) % $swaplevel1dirs,
                    (($cachefile / ($#cachedir + 1)) / $swaplevel1dirs) % $swaplevel2dirs,

This sub has to be called with something like this:

$object = cachefile_to_object($cache_file,$swap_level1_dirs,$swap_level2_dirs,@cache_dir);

$cachefile is 0008afcc (from your example)
$swap_level1_dirs from your squid.conf (default: 16)
$swap_level2_dirs from your squid.conf (default: 256)
@cache_dir is an array with all your cache-directories as specified
        in your squid.conf

Hope this helps,

Cord Beermann IRC: Cord@Wunder-Nett
Received on Mon Jun 09 1997 - 00:19:20 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:35:29 MST