Other apps create filenames containing one or more commas.
None of the file actions in AUTOMAGIC seem to be able to handle these files.
Is this a bug?
I need a solution how to perform the file operations with filenames contained in {registered_path}/{path}.
BUG? Comma in filename, no file access / operation possible?
Moderator: Martin
Re: BUG? Comma in filename, no file access / operation possi
Hi,
A file name containing a comma needs to be escaped with double quotes when an action supports a comma delimited list of files.
Assume there exists a file with name file1.txt and a file special,file,name.txt. A field in an action that processes both files should look like this: file1.txt,"special,file,name.txt" or "special,file,name.txt" when you only want to process one file.
I'm aware that the file picker of Automagic does not escape the commas on its own, which is definitely a bug. This bug should be resolved in the next update.
Regards,
Martin
A file name containing a comma needs to be escaped with double quotes when an action supports a comma delimited list of files.
Assume there exists a file with name file1.txt and a file special,file,name.txt. A field in an action that processes both files should look like this: file1.txt,"special,file,name.txt" or "special,file,name.txt" when you only want to process one file.
I'm aware that the file picker of Automagic does not escape the commas on its own, which is definitely a bug. This bug should be resolved in the next update.
Regards,
Martin
Re: BUG? Comma in filename, no file access / operation possi
I tried that before I posted but without success.
How exactly can I add double quotes as a
remedy in my example with the filename and path in the variables?
How exactly can I add double quotes as a
remedy in my example with the filename and path in the variables?
Re: BUG? Comma in filename, no file access / operation possi
Maybe I'm testing with the wrong actions. What action exactly does not work? Could you please post a simple example flow so I can reproduce this issue?
For example following setting in an action Delete Files should work "{registered_path}/{path}" since the variables are replaced before the Delete Files action processes the comma separated list in the field Files.
For example following setting in an action Delete Files should work "{registered_path}/{path}" since the variables are replaced before the Delete Files action processes the comma separated list in the field Files.
Re: BUG? Comma in filename, no file access / operation possi
http://automagic4android.com/flow.php?i ... 0ea466d33e
als Workaround, um MP3 Dateien, wenn sie im Dateinamen ein Komme enthalten, per *.mp3 in eine Zip Datei zu bekommen.
Kopieren, verschieben, löschen, zippen, bei allen ist der direkte Dateiname aus {registered_path}/{path} unvollständig,
wenn dieser ein Komma beinhaltet,
Beispiel .../BACH/Andrew Senn - BACH- Toccata, Adagio und Fuge C-Dur (BWV 564).mp3
Umschließe ich wie genannt mit Anführungszeichen "{registered_path}/{path}" ,
dann zeigt der Debug Dialog als exception message
/"/storage/extSdCard/...................../korrekter_Dateiname.mp3" open failed: ENOENT (No such file or directory)
Wenn ich als Kopierziel noch eine weitere Variable {mpath} in den Dateipfad einbinde
/storage/extSdCard/{mpath}/{path}
Wie müssen die Anführungszeichen gesetzt werden?
Ein Verständnisproblem noch dazu: warum heißt die Variable /{path} und beinhaltet eher den Dateinamen ?
http://automagic4android.com/flow.php?i ... c3689aa635
als Workaround, um MP3 Dateien, wenn sie im Dateinamen ein Komme enthalten, per *.mp3 in eine Zip Datei zu bekommen.
Kopieren, verschieben, löschen, zippen, bei allen ist der direkte Dateiname aus {registered_path}/{path} unvollständig,
wenn dieser ein Komma beinhaltet,
Beispiel .../BACH/Andrew Senn - BACH- Toccata, Adagio und Fuge C-Dur (BWV 564).mp3
Umschließe ich wie genannt mit Anführungszeichen "{registered_path}/{path}" ,
dann zeigt der Debug Dialog als exception message
/"/storage/extSdCard/...................../korrekter_Dateiname.mp3" open failed: ENOENT (No such file or directory)
Wenn ich als Kopierziel noch eine weitere Variable {mpath} in den Dateipfad einbinde
/storage/extSdCard/{mpath}/{path}
Wie müssen die Anführungszeichen gesetzt werden?
Ein Verständnisproblem noch dazu: warum heißt die Variable /{path} und beinhaltet eher den Dateinamen ?
http://automagic4android.com/flow.php?i ... c3689aa635
Re: BUG? Comma in filename, no file access / operation possi
Bei einigen Actions unterstützt Automagic eine Komma separierte Liste als Input, z.B. bei Action Dateien kopieren. Dort muss der Pfad der Quelldateien mit Anführungszeichen umschlossen werden, damit Automagic nicht meint, dass es sich um mehrere Dateien handelt. In deinem zweiten Flow müsste es bei Feld Quelldateien deshalb "{registered_path}/{path}" heissen. Bei Ziel /storage/extSdCard/AUDIALS/{mpath}/{path} (ohne Anführungszeichen), da Ziel ein einzelner Pfad ist und keine Liste). Beim Ziel ist zudem zu beachten, dass der Zielordner bereits existieren muss.
Das Naming von Variable {path} habe ich von der API in Android übernommen. Vermutlich wurde von Android path gewählt, da es sich um eine Datei oder ein Verzeichnis handeln kann. Bei inotify selbst wurde name verwendet, was vermutlich die bessere Wahl gewesen wäre.
Beim Pfad /storage/extSdCard/ klingeln bei mir die Alarmglocken. Ab Android Version 4.4 erlaubt Android nur noch lesenden Zugriff auf diesen Ordner, insofern das ROM nicht modifiziert wird.
Das Naming von Variable {path} habe ich von der API in Android übernommen. Vermutlich wurde von Android path gewählt, da es sich um eine Datei oder ein Verzeichnis handeln kann. Bei inotify selbst wurde name verwendet, was vermutlich die bessere Wahl gewesen wäre.
Beim Pfad /storage/extSdCard/ klingeln bei mir die Alarmglocken. Ab Android Version 4.4 erlaubt Android nur noch lesenden Zugriff auf diesen Ordner, insofern das ROM nicht modifiziert wird.