Python script to remove "._XXXXX.cia" files generated by Finder

Discussion in '3DS - Homebrew Development and Emulators' started by Lucas Broadwing, Feb 13, 2016.

  1. Lucas Broadwing
    OP

    Lucas Broadwing Newbie

    Newcomer
    3
    2
    Feb 13, 2016
    United States
    So my friend that's supplying me with most of the files i need uses a mac, which is cool and all, but now all of my folders full of .cia files that I need to batch install are filled with cache files that finder creates that are picked up by the installers and generate errors. Previously his solution has been just "Open it up on windows and delete the ._ files" but that's annoying. So I made a script that searched through the given directory and all subdirectories and removes any files starting with "._". Seeing as I personally have a Windows I can't test how well it works, but what I speculate the steps needed to be taken on a Mac for this are
    1. Copy the directory to search
    2. Close any open Finder windows in the directory or it's subdirectories
    3. Run the script, pasting in the directory
    4. Eject the card without opening up the finder window for it
    If someone could test this for me and give me some feedback, I'd greatly appreciate it.

    Made with Python version 3.5. I've never used a Python version under 3 and iirc macs come pre-installed with 2.7 so that may or may not pose an issue. Worst case scenario it gives you an error which I'd like you to just post here.

    Edit: I was crashing when I ran it with certain filenames that had non-printable characters, so I fixed that.
     

    Attached Files:

    Last edited by Lucas Broadwing, Feb 13, 2016