Hi, all.
Does anyone have a suggestion to ignore hidden files preceded by a dot? hcs/folder_list outputs all the files matching a wildcard pattern. Seems like there should be some way to look for files that start with a dot and not pass them.
I'm loading a directory of audio files but there are a ton of ._files.wav that were created by OSX. I've got a bunch of audio sample directories like this and I could go through and remove all these files, but this software will also be used by someone on a Mac, so it's better to just ignore this inconvenient OS behavior if possible.
Thanks! Sam
Samuel Burt wrote:
Hi, all.
Does anyone have a suggestion to ignore hidden files preceded by a dot? hcs/folder_list outputs all the files matching a wildcard pattern. Seems like there should be some way to look for files that start with a dot and not pass them.
there's no way to achive that with [folder_list] itself.
you would have to examine every line of ouput, i'm afraid ...
1.) use [hcs/split_path] to just get the filename (without path) 2.) use vanilla's [list fromsymbol] to check for dots (ASCII code 46) at the beginning of the list
...
best
oliver
I figured it out on my own. For anyone searching here's a solution.
[hcs/folder_list] outputs the entire pathname and includes hidden files.
[splitfilename] splits the directory from the file and outputs each.
[list fromsymbol] changes a symbol into a list of numbers. The number 46 is the preceding dot of hidden files.
[route 46] will catch all files starting with a dot. The right outlet outputs everything else.
[list tosymbol] will reassemble the file name into a symbol.
The rest of the code recombines the path with the reconstituted file name.
Voila! Hidden files are ignored. Is there a simpler solution?
[image: image.png]
On Tue, May 4, 2021 at 9:07 AM Samuel Burt composer.samuel.burt@gmail.com wrote:
Hi, all.
Does anyone have a suggestion to ignore hidden files preceded by a dot? hcs/folder_list outputs all the files matching a wildcard pattern. Seems like there should be some way to look for files that start with a dot and not pass them.
I'm loading a directory of audio files but there are a ton of ._files.wav that were created by OSX. I've got a bunch of audio sample directories like this and I could go through and remove all these files, but this software will also be used by someone on a Mac, so it's better to just ignore this inconvenient OS behavior if possible.
Thanks! Sam
Hi Samuel,
On 04/05/2021 14:47, Samuel Burt wrote:
I figured it out on my own. For anyone searching here's a solution.
Does it work correctly when changing directories? I would expect [splitfilename] to output from right to left, which means the previous file's directory is used for each file...
Voila! Hidden files are ignored. Is there a simpler solution?
maybe something like this (untested)
| [hcs/folder_list] | [t a a] | | | [splitfilename] | | | [list fromsymbol] | | | [route 46] | | | | [0( [1( | ______/_______/ | / [spigot] |
you can try [else/dir], tell me if it works and filters these out. If it doesn't, I'll fix it, but the idea is that it does that.
cheers
Em ter., 4 de mai. de 2021 às 10:09, Samuel Burt < composer.samuel.burt@gmail.com> escreveu:
Hi, all.
Does anyone have a suggestion to ignore hidden files preceded by a dot? hcs/folder_list outputs all the files matching a wildcard pattern. Seems like there should be some way to look for files that start with a dot and not pass them.
I'm loading a directory of audio files but there are a ton of ._files.wav that were created by OSX. I've got a bunch of audio sample directories like this and I could go through and remove all these files, but this software will also be used by someone on a Mac, so it's better to just ignore this inconvenient OS behavior if possible.
Thanks! Sam
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
since hcs/folder_list uses globs you can just insert [!.] before the filename to exclude all files that start with ".":[symbol [!.]*.wav(or[symbol subdirectory/[!.]*.wav( -seb
-----Original Message----- From: Samuel Burt composer.samuel.burt@gmail.com To: Pd-list pd-list@lists.iem.at Sent: Tue, May 4, 2021 6:07 am Subject: [PD] ignore hidden files from hcs/folder_list
Hi, all. Does anyone have a suggestion to ignore hidden files preceded by a dot? hcs/folder_list outputs all the files matching a wildcard pattern. Seems like there should be some way to look for files that start with a dot and not pass them. I'm loading a directory of audio files but there are a ton of ._files.wav that were created by OSX. I've got a bunch of audio sample directories like this and I could go through and remove all these files, but this software will also be used by someone on a Mac, so it's better to just ignore this inconvenient OS behavior if possible. Thanks!Sam _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I'm assuming you feed the input of [hcs/folder_list] with the message [symbol [!.]*( yes? When I do I get an error where it doesn't find any files. [folder_list] nothing found for "C:/Users/username/Music/Samples/crotales/[!.]*.wav"
I am not sure it's actually disregarding hidden files but more likely looking for a file that starts with "[!.]". Am I wrong?
On Tue, May 4, 2021 at 7:08 PM Sebastian Shader sebfumaster@aol.com wrote:
since hcs/folder_list uses globs you can just insert [!.] before the filename to exclude all files that start with ".": [symbol [!.]*.wav( or [symbol subdirectory/[!.]*.wav(
-seb
-----Original Message----- From: Samuel Burt composer.samuel.burt@gmail.com To: Pd-list pd-list@lists.iem.at Sent: Tue, May 4, 2021 6:07 am Subject: [PD] ignore hidden files from hcs/folder_list
Hi, all.
Does anyone have a suggestion to ignore hidden files preceded by a dot? hcs/folder_list outputs all the files matching a wildcard pattern. Seems like there should be some way to look for files that start with a dot and not pass them.
I'm loading a directory of audio files but there are a ton of ._files.wav that were created by OSX. I've got a bunch of audio sample directories like this and I could go through and remove all these files, but this software will also be used by someone on a Mac, so it's better to just ignore this inconvenient OS behavior if possible.
Thanks! Sam
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
oh, maybe windows doesn't have that kind of globbing. guess it only works on unix
dang -----Original Message----- From: Samuel Burt composer.samuel.burt@gmail.com To: Sebastian Shader sebfumaster@aol.com Cc: pd-list@lists.iem.at pd-list@lists.iem.at Sent: Wed, May 5, 2021 10:37 am Subject: Re: [PD] ignore hidden files from hcs/folder_list
I'm assuming you feed the input of [hcs/folder_list] with the message [symbol [!.]*( yes?When I do I get an error where it doesn't find any files.[folder_list] nothing found for "C:/Users/username/Music/Samples/crotales/[!.]*.wav"
I am not sure it's actually disregarding hidden files but more likely looking for a file that starts with "[!.]". Am I wrong?
On Tue, May 4, 2021 at 7:08 PM Sebastian Shader sebfumaster@aol.com wrote:
since hcs/folder_list uses globs you can just insert [!.] before the filename to exclude all files that start with ".":[symbol [!.]*.wav(or[symbol subdirectory/[!.]*.wav( -seb
-----Original Message----- From: Samuel Burt composer.samuel.burt@gmail.com To: Pd-list pd-list@lists.iem.at Sent: Tue, May 4, 2021 6:07 am Subject: [PD] ignore hidden files from hcs/folder_list
Hi, all. Does anyone have a suggestion to ignore hidden files preceded by a dot? hcs/folder_list outputs all the files matching a wildcard pattern. Seems like there should be some way to look for files that start with a dot and not pass them. I'm loading a directory of audio files but there are a ton of ._files.wav that were created by OSX. I've got a bunch of audio sample directories like this and I could go through and remove all these files, but this software will also be used by someone on a Mac, so it's better to just ignore this inconvenient OS behavior if possible. Thanks!Sam _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list