App-FileComposer

 view release on metacpan or  search on metacpan

lib/App/FileComposer.pm  view on Meta::CPAN




   		{

        #// define a temp file
        my $temp = "temp.$$";

        #// copy data in sample file to the temp file 
        #// after that, rename it 
        open INPUT , '<', "$origin/$i_found" 
            or die "error: $! \n";

                  # my @filesize = <INPUT>;
                  
        open OUTPUT, '>>', "./$temp" 
            or die "cannot write to $temp, error: $!\n";
        my $bar = Progress::Awesome->new(1000, style => 'rainbow', title => 'loading...');

         while (<INPUT>) {
                  print OUTPUT $_;
                  $bar->inc();
                  select(undef, undef, undef, 0.010);
                  

               }

                close(INPUT);
                close(OUTPUT);
                  rename $temp, $filename;
                  $bar->finish;
 

   
     		}

}




( run in 0.445 second using v1.01-cache-2.11-cpan-4e96b696675 )