#!/usr/bin/perl

use strict;
use warnings;

#use Carp qw(confess);
#use Data::Dumper;
use File::Basename;
use Getopt::Std;
#use POSIX qw(ceil);
#use XML::LibXML;

use Ernad::Erimp;
#use Ernad::Common;
#use Ernad::Dates;
#use Ernad::Sort;
#use Ernad::Generate;
use Ernad::Yanabino;

binmode(STDOUT,":utf8");


die "Do not uses this script, it destroys queue information.";

# ## options
# my %o;
# getopts("d:", \%o) or die;
#
# my $impna=$ARGV[0] // '';
# if(not $impna) {
#   print "I need an impna.\n";
#   exit;
# }
#
# our $e=Ernad::Erimp->new({'impna'=>$impna});
#
# my $days_argument=$ARGV[1] // 30;
#
# my $piles_dir=$e->{'dir'}->{'pile'} // die "I don't see the pile_dir.";
#
# foreach my $file (`find $piles_dir -type f`) {
#   chomp $file;
#   my $bana=basename($file);
#   if(not $bana=~m|^\d{4}-\d{2}-\d{2}\.xml$|) {
#     next;
#   }
#   my $count=&Ernad::Yanabino::count_texts_in_file($file);
#   if($count) {
#     next;
#   }
#   ## test this by greping
#   #my $grep=`grep /text $file`;
#   #chomp $grep;
#   #if($grep) {
#   #  print "I have a grep $grep in $file with $count\n";
#   #}
#   unlink $file;
# }
#
# ## remove empty dirs
# system("find $piles_dir -type d -empty -delete");
#
#
# exit;
