Copying files to Win volumes without hidden files

Posted:
in macOS edited January 2014
Wonder if there's anyway copying files to those Windows formatted medium without any OS X exclusive hidden files like ".DS" ".Trash" ".Volume" etc etc.



When I am transferring files to other people's machine (PC) they keep yelling at me that I am giving them some junk files (those OSX hidden files)



Also....it is very annoying that when I transfer the MP3 files to the USB-pen MP3 players (which formatted in FAT 16) the file transfer is fine but those hidden files are also being transfer. When the player is reading those files the play will just stall. My workaround is to plug this player on PC and manually delete all those files starting with "."



Comments

  • Reply 1 of 6
    Are you using 10.3? Since upgrading, I haven't noticed invisible files, especially the .DS Store files, copied over to Windows volumes.
  • Reply 2 of 6
    badtzbadtz Posts: 949member
    Quote:

    Originally posted by k squared

    Are you using 10.3? Since upgrading, I haven't noticed invisible files, especially the .DS Store files, copied over to Windows volumes.



    when you zip archives, it still shows all of the hidden files on the windows side.
  • Reply 3 of 6
    10.3 still leaves the hidden files.
  • Reply 4 of 6
    curufinwecurufinwe Posts: 104member
    Leonis, great topic.



    I also want to use windows only mp3 players (got a cheap one as a gift) and have found that the the resource forks (the ".files") Keep screwing stuff up. The players just have regular flash drives, which can be mounted by a mac, but the players choke on the hidden files and resource forks that macs throw around.



    It seems that we need to know how can you tell a mac to:



    1. Mount a drive and not copy over the .Trash .Desktop and .Dstore mess that the Finder does everytime you mount a new volume.



    2. Copy over only the data forks of the files that we want to place there. (No .file mess!!!!!)



    I suspect the answer is a unixy command line process, but I would undertake that in order to get my el cheapo mp3 player to work with my macs.



    Anyone feeling brilliant out there?



    Thanks,



    Curufinwe
  • Reply 5 of 6
    gongon Posts: 2,437member
    If you can reach the Windows files through Terminal, it should only take a line of code to remove the hidden files. I'll try reading some man pages to see how to do this.



    rm -r .* catches . and .. so that is no good.



    rm -r .[^.]* initially seems to work well, but when I tried it out it didn't remove a hidden file in a subdirectory.. I wonder why that is. I used tcsh.



    Then I tried a different approach, and I think it was successful. This line takes out all files starting with a dot:



    find . -name .\\?\\* | xargs rm



    edit: It's dumb but I have to say this just in case... do NOT do this anywhere on your hard drive!

    This approach could be automated further into a program (Applescript?) but the best solution would be to find a way to tell OS X to never even make the files.



    2nd edit: I did a little reading at macosxhints.com. You need to do this

    find . -name .\\?\\* -print0 | xargs -0 rm

    to ensure it handles directory paths with spaces.

    There's also a readymade program to do the same thing: Chop
  • Reply 6 of 6
    leonisleonis Posts: 3,427member
    BIG NEWS!



    I found out someone at MacOSXHints.com mentioned a little self-running Apple Script called "Cleanup SMB Mess" (do a search in Versiontracker and you will find it)



    What I did is after I move the files to the Windows volume and the USB MP3 players I drag the ENTIRE volumes on this little AppleScript apps and do the clean up. After that all hidden files (.DS .Trash "." everything) are gone.....
Sign In or Register to comment.