Re: [netatalk-admins] afpd: incorrect appledouble header


Subject: Re: [netatalk-admins] afpd: incorrect appledouble header
From: Steven N. Hirsch (shirsch@adelphia.net)
Date: Sun Feb 07 1999 - 18:09:21 EST


On Sat, 6 Feb 1999, Robert Sweet wrote:

> Feb 6 20:15:34 robs afpd[622]: warning: incorrect appledouble header. run
> 'adv1tov2 -v1compat' when you upgrade to asun2.2.0.
>
> I have looked high and low for this, can someone point me to where to download
> this file or how to fix the incompatability? Or to I just delete all the
> .AppleDouble dirs?
>

For the second time, I'm posting a Perl script which I've used here to fix
an entire tree:

------------------- Cut Here ---------------------------
: # -*-perl-*-
eval 'exec perl -w -S $0 ${1+"$@"}'
    if 0;

use strict;
use POSIX qw(fcntl_h);
use IO::File;
use File::Find;
use Cwd;

# Traverse desired filesystems

my $magic = pack "C4", 0x00, 0x05, 0x16, 0x07;
my $adVersion = pack "C4", 0x00, 0x01, 0x00, 0x00;

sub fixADFiles {
  my $curdir = cwd();
  chdir('.AppleDouble');
  foreach ( glob '*' ) {
    my $fh = new IO::File;
    print "$_\n";
    $fh->open($_, O_WRONLY) || die "Can't open $File::Find::name: $!\n";
    $fh->print($magic);
    $fh->print($adVersion);
    $fh->close;
  }
  chdir($curdir);
}

sub wanted {
  my $globalSave = $_;

    (my ($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
    -d _ &&
    /^\.AppleDouble$/ &&
    fixADFiles();

  $_ = $globalSave;
}

@ARGV == 1 || die "Usage: fixad <dir>\n";

my $dir = shift;

find(\&wanted, $dir);

exit;
-------------------Cut Here ----------------------------



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:16:18 EST