Subject: RE: What is the special character at the end of the Icon^M files?

From: [email-masked]
Date: Wed, 12 Dec 2001 11:32:32 -0800

I had the same problem when I was converting from CAP to netatalk.  I wrote
the following perl script and proved that the file name is "Icon\r" (a
return character or control-m).  I couldn't figure it out with a shell
script. You run it at the top level of the file share. Once I had determined
the character, I was able to write additional scripts to manipulate or
customize it.

#!/usr/local/bin/perl -w

#
# Finds a netatalk icon file
#    Celeste Suliin Burris May 2001
#

# Open the current directory using opendir.
my $filename = "";
my $iconfile = "Icon\r";
opendir (DIRHANDLE, ".");

# Read in each file using readdir

@filelist = readdir (DIRHANDLE);

closedir (DIRHANDLE);

# Cycle through file list
foreach $file (@filelist)
{
        $filename = $file;
        $fnlength = length($filename);
        if ($filename eq $iconfile)
"find_icon.pl" 29 lines, 509 characters
geobase1{csburris}28: cat find_icon.pl
#!/usr/local/bin/perl -w

#
# Finds a netatalk icon file
#    Celeste Suliin Burris May 2001
#

# Open the current directory using opendir.
my $filename = "";
my $iconfile = "Icon\r";
opendir (DIRHANDLE, ".");

# Read in each file using readdir

@filelist = readdir (DIRHANDLE);

closedir (DIRHANDLE);

# Cycle through file list
foreach $file (@filelist)
{
        $filename = $file;
        $fnlength = length($filename);
        if ($filename eq $icon!
!
file)
        {
           print "icon file found, name contains $fnlength chars\n";
        }
}

Celeste Suliin Burris
Systems Administrator
Tacoma Economic Development Dept.
[email-masked]

> ----------
> From: 	Simon Hobson
> Sent: 	Tuesday, December 11, 2001 3:25 AM
> To: 	[email-masked]
> Subject: 	Re: What is the special character at the end of the Icon^M
> files?
> 
> 
> Frank Joerdens wrote:
> >I mean the Icon files that the Apple clients leave all over the place
> >(incidentally, does anyone know what they are for?). The bash shell
> >represents it as a ?, like
> >
> >Icon?
> >
> >and the Midnight Commander, for instance, as
> >
> >Icon^M
> 
> If MC represents it as ^M then it is most likely a carriage return
> character. You can normally get this direct from the keyboard by typing
> <Ctrl-V><Ctrl-M>.
> 
> Simon
> 
> -
> Simon Hobson, Technical Services Engineer
> Colony Gift Corporation Limited
> Lindal in Furness, Ulverston, Cumbria, LA12 0LD
> Tel 01229 461100, Fax 01229 461101
> 
> Registered in England No. 1499611
> Regd. Office : 100 New Bridge Street, London, EC4V 6JA.
> 
> 
>