Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
If its any help to you, I edited bart's code to not work in a command prompt. The only thing is you have to set the values of the variables in the code.
#!perl use Archive::Tar; $Archive::Tar::DO_NOT_USE_PREFIX = 1; use strict; my %opt = ( 'quickfix' => 1, # quick fix - with out world writeables 'verbose' => 1, # print some text when working 'output' => 'Fixed_Archive.tar.gz', # rename file to ); my $dist = 'C:\Path\to\with-out-world-writeables.tar.gz'; # Path and F +ile to fix print 'Starting the Fix File: '.$dist."\n".' and rename to '.$opt{outp +ut}."\n" if $opt{verbose}; my $fixes; my $tar = Archive::Tar->new; $tar->read($dist); my @files = $tar->get_files; foreach my $file (@files) { my $fixedmode = my $mode = $file->mode; my $filetype = ''; if($file->is_file) { $filetype = 'file'; if($opt{quickfix}) { $fixedmode &= ~2; } elsif(substr(${ $file->get_content_by_ref }, 0, 2) eq '# +!') { $fixedmode = 0775; } else { $fixedmode = 0664; } } elsif($file->is_dir) { $filetype = 'dir'; if($opt{quickfix}) { $fixedmode &= ~2; } else { $fixedmode = 0775; } } else { next; } next if $mode eq $fixedmode; $file->mode($fixedmode); $fixes++; print "\nChange mode %03o to %03o for %s '%s'\n", $mode, $fixe +dmode, $filetype, $file->name if $opt{verbose}; } if($fixes) { $dist = $opt{output} if $opt{output}; $tar->write($dist, 9); print "\nFile '$dist' saved.\n" if $opt{verbose}; }

I just tested it on PAUSE and it works.

In reply to Re^2: Bench this BBcode by SFLEX
in thread Bench this BBcode by SFLEX

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    Domain Nodelet?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others musing on the Monastery: (5)
    As of 2024-07-14 10:27 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found

      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.