LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Samba and Dave (https://www.linuxquestions.org/questions/linux-networking-3/samba-and-dave-7587/)

Zorba 10-16-2001 08:02 AM

Samba and Dave
 
Totally newbie.

When I try to copy a file from my mac (Dave installed) to my Linux-box the file
becomes 3 where one is the correct file and the other gets the ext. AfpInfo: $DATA and AFP Resource:$DATA.

How do I get rid of these?

bmckee 10-16-2001 04:16 PM

Samba and Dave
 
Not a solution, but might help....for what it's worth
(I'm a real Linux newbie, but have some Mac experience) I believe those two other 'files' are the 'resource forks' that Macs use instead of .xxx file name extensions to identify file type, icon etc. Don't know how to 'shut it off' but I would think it should be an option in there somewhere. What happens if you zip it or binhex it and then unzip in Linux? Note that if you do 'get rid of it' when you copy file back to Mac you probably will end up with a blank icon and no program associated to run it.

Hmm - just had a thought - I'm assuming you aren't using OSX - I haven't got a clue how it works (yet)

DMR 10-16-2001 08:10 PM

bmckee nailed it.
AFP is Apple File Protocol, and the "extra" files are components of the "real" file that the Mac OS keeps hidden from you. You'll see the same thing if you put a PC-formatted floppy in a Mac, copy a file to it, and take it back to the PC. Windows will display not only the core file, but a lot of other "Mac droppings".

You don't want to delete/move/rename these components if you need to use the file in a Mac again.

billster 07-22-2004 06:33 PM

One reason you might want to remove the AFPInfo files: they don't play nicely with Windows.

If you set up a Samba server on your Linux box, then try to copy files from it to your PC, the copy action will fail on any AFPInfo file.

If you have thousands of files, it can take many hours to clear all those files out just to do a simple copy. Or, you can use this perl script to do it in 10 seconds:
----------------------------------------------
#!/usr/bin/perl -w

use File::Find;

sub process_file {
$name = $File::Find::name;

if ( ($name =~ /AFP_AfpInfo/) ) {
print "Deleting: $File::Find::name\n";
# unlink ("$name");
}
}

@ARGV = ('.') unless @ARGV;

find (\&process_file, @ARGV);
-----------------------------------------------

This script accepts one or more directories as arguments. It then recursively searches them for the dreaded AFPInfo files, and deletes them all. The code is grafted from two examples in O'Reilly's "Perl Cookbook."

Test it first by running it with the "unlink" (delete) command commented out, as shown. Verify that it's not about to delete anything you want to keep. Then uncomment the "unlink" and run it again. All your Mac extension files will be removed.

I accept no liability if this script eats your homework. However, it did work for me.


All times are GMT -5. The time now is 02:39 PM.