sole / aafm

Android ADB file manager
GNU General Public License v3.0
222 stars 50 forks source link

Linux (possibly others) ampersand in filename #67

Open chriscamacho opened 8 years ago

chriscamacho commented 8 years ago

NB gui just shows none moving progress bar (but still responsive to closing window) no error message on gui

console output as follows:

EXECUTE ('adb', '-s', '0929e3ef', 'shell', 'mkdir', '/mnt/sdcard/Music/Bob Marley & The Wailers')
EXECUTE ('adb', '-s', '0929e3ef', 'shell', 'ls', '-l', '-a', '/mnt/sdcard/Music/Bob Marley & The Wailers/')
/system/bin/sh:  The Wailers/: not found wasn't matched, please report to the developer!
/mnt/sdcard/Music/Bob Marley : No such file or directory wasn't matched, please report to the developer!
EXECUTE ('adb', '-s', '0929e3ef', 'shell', 'mkdir', "/mnt/sdcard/Music/Bob Marley & The Wailers/Talkin' Blues")
EXECUTE ('adb', '-s', '0929e3ef', 'shell', 'ls', '-l', '-a', '/mnt/sdcard/Music/Bob Marley & The Wailers/')
/system/bin/sh:  The Wailers/: not found wasn't matched, please report to the developer!
/mnt/sdcard/Music/Bob Marley : No such file or directory wasn't matched, please report to the developer!
EXECUTE ('adb', '-s', '0929e3ef', 'shell', 'mkdir', '/mnt/sdcard/Music/Bob Marley & The Wailers/Legend')
EXECUTE ('adb', '-s', '0929e3ef', 'shell', 'ls', '-l', '-a', '/mnt/sdcard/Music/Bob Marley & The Wailers/')
/system/bin/sh:  The Wailers/: not found wasn't matched, please report to the developer!
Traceback (most recent call last):
  File "./aafm-gui.py", line 850, in process_queue_task
    src(*dst)
  File "/home/chris/development/aafm/src/Aafm.py", line 265, in copy_file_to_device
    assert self.is_device_file_a_directory(os.path.dirname(device_file))
AssertionError
chriscamacho commented 8 years ago

find . -depth -name '&' -execdir bash -c 'mv "$1" "${1//&/and}"' _ {} \;

rename recusivly all files in current working path, replacing & with and

(work-a-round)

sole commented 8 years ago

Thanks for filing the issue! It does look like we should escape things better, not force people to rename their files! :-)

chriscamacho commented 8 years ago

lol - for sure (was just temp thing in case ppl needed something to work NOW!) ;) btw don't feel too bad it transferred around 4GB with this being the only issue, and it compiles nice and easy too...

zymos commented 8 years ago

Ive also found that a semicolon(;) also causes this problem

xeruf commented 6 years ago

I have added escaping in my fork