[netatalk-admins] Script for renaming files for Mac to PC transfer


Subject: [netatalk-admins] Script for renaming files for Mac to PC transfer
From: Jonathan Benson (tech@phoenixmags.com.au)
Date: Mon Apr 12 1999 - 03:28:56 EDT


I've just been switching a number of users over from Mac to PC. As part
of that process I've been copying their files (Word and Excel mainly) on
to the server (via netatalk) which is the same partition shared to the
PC users via Samba.

When trying to copy the folder on to their new PC I discovered numerous
problems with filenames that were valid on Mac but not on PC. As I've
had this problem in the past I thought I'd write a little Perl script to
ease the renaming of files.

So I've attached it to this message.

I take NO RESPONSIBILITY for what this might do to your system, although
since it only renames files it should be fairly safe.

The only problem I can forsee is if you rename a Mac program
(executable) whilst it renames the resource file it doesn't edit the
resource file to reflect the new name and hence the program may not run
anymore. Although that said, I just did a brief test by allowing it to
rename a program and the program still ran from the Mac afterwards.

Anwyay, I hope this is of some help to all.

Oh, to use it, just cd to the parent of the directories you want to
rename files under and run it. Sorry for the lack of documentation, etc
but this is just something I wrote for myself and thought others might
be able to use.

Interesting note. There is one type of filename that gave me a problem
that I didn't suspect would. Specifically one of the form "filename."
Ie. ending in a period "."

This is a valid PC filename but under the version of netatalk/Samba I'm
running a filename of that type created on a Mac could not be read on a
PC. Quite strange. I don't have the time or inclination to investigate
further but if you want to remove that type of file it's the last patter
in that badpats array.

Regards

Jonathan

--
Jonathan Benson B.Eng. (Soft Sys Hon) <tech@phoenixmags.com.au>
Systems Administrator, Phoenix Magazines, Phone: +61 3 9696 7200
http://www.phoenixmags.com.au/


mactopc



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