summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.local/bin/flacdir35
1 files changed, 35 insertions, 0 deletions
diff --git a/.local/bin/flacdir b/.local/bin/flacdir
new file mode 100755
index 0000000..625e72e
--- /dev/null
+++ b/.local/bin/flacdir
@@ -0,0 +1,35 @@
+#!/usr/local/bin/perl
+
+use warnings;
+use strict;
+
+use constant FLAC_PATH => '/usr/local/bin/flac';
+
+sub main
+{
+ opendir(DIR, '.') or die "Cannot open directory: $!";
+ # my @files = readdir(DIR);
+ my @files = grep(/\.wav$/, readdir(DIR));
+ closedir(DIR);
+ foreach (@files) {
+ if (
+ system(
+ FLAC_PATH,
+ '--warnings-as-errors',
+ '--compression-level-0',
+ '--verify',
+ $_
+ ) != 0
+ ) {
+ exit 1;
+ }
+ else {
+ unlink($_);
+ }
+ }
+ return;
+}
+
+main();
+
+__END__