Robin,
Thanks for the information about the file comments. The program I am writing is
to replace an AppleScript that used the FileSharing on AppleTalk to move files
around. The comments were preserved with this technique. I am re-writing it so
that it can run on Windows too, so I chose Perl. I thought FTP would be the
protocol to use for file transfer between different platforms. We were using the
comment feature to transport information with the file that is later entered
into a database on the server. Maybe I have to create a simple text file, copy
the comment info. into it, and ftp that too. I can name the text file the same
as the jpeg, but with a .txt file extension. How does that sound?
Kathy
>[EMAIL PROTECTED]:
>I am trying to put a jpeg on a server and having file corruption
>problems.......
>Another problem is that the file's comment field data is missing.
>Fetch and Net::FTP.
firstly make sure you are uploading the file as 'binary' - FTP progs
like Fetch switch data formats automatically , Net::FTP has to be
told.
As to the file comments - Mac files are alone in the world of
computing - they are divided in two parts called 'forks', one is
called the data fork the other is called the resource fork. The
resource fork is where the file info and icon are stored, the data
fork is where the data is stored (the picture, in the case of the
jpeg). I'm conjecturing here but most probably as the file is passed
through FTP it's resource fork may not be getting passed with it, or
only basic stuff like the creator code, file type and icon. You can
however use Mac Perl to copy comments from a file or set them
(more info in the 'MacPerl: Power and Ease book' :
http://macperl.com/macperl/ptf_book/r/MP/i2.html)
#!perl -w
# Script courtesy of the above link:
# sets the comments for the MacPerl app to 'Power and Ease'
# then copies the comments to a second file
use Mac::MoreFiles;
my($file1, $file2);
$file1 = MacPerl::MakeFSSpec($Application{'McPL'});
$file2 = MacPerl::MakeFSSpec('HD:Files:file.txt');
FSpDTSetComment($file1, 'Power and Ease');
FSpDTCopyComment($file1, $file2);
print FSpDTGetComment($file2), "\n";
__END__
So if the comments are important to you, you can get and set them
using the commands above, providing of course you do this on a Mac.
HTH
Robin