summaryrefslogtreecommitdiffstats
path: root/.local/bin/flacdir
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2021-03-09 15:32:52 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2021-03-09 15:32:52 +0100
commite5de60cc7d7826b7f82ec1ee8ab740491238c463 (patch)
tree3b944b2f85ebd4bc9493345e95f8fb899252cd1d /.local/bin/flacdir
parentok (diff)
downloaddotfiles-bsd-e5de60cc7d7826b7f82ec1ee8ab740491238c463.tar.gz
dotfiles-bsd-e5de60cc7d7826b7f82ec1ee8ab740491238c463.tar.bz2
dotfiles-bsd-e5de60cc7d7826b7f82ec1ee8ab740491238c463.tar.xz
dotfiles-bsd-e5de60cc7d7826b7f82ec1ee8ab740491238c463.tar.zst
dotfiles-bsd-e5de60cc7d7826b7f82ec1ee8ab740491238c463.zip
fixed emacs
Diffstat (limited to '.local/bin/flacdir')
-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__