Char-UHC

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

  - import $fix_drive_relative_paths from File::DosGlob/1.04
  - support regexp metasymbols \C and \R in regexp
  - support regexp metasymbol \N \N{3} \N{3,} \N{3,5}
  - \N{CHARNAME} means literal N{CHARNAME}
  - \p{PROP} means literal p{PROP}
  - \P{PROP} means literal P{PROP}
  - \X means literal X
  - support POSIX-style character classes
  - modifier /a /d /l /u, and /aa of regexp makes die
  - use 5.12.0; --> use 5.12.0; no strict qw(refs);
  - remove test 201_kanji.t,202_kanji.t,203_kanji.t,204_kanji.t,205_glob.t,210_chmod.t,211_chown.t,212_dbmopen.t,214_glob.t,216_open.t,217_qx.t,218_rename.t,221_sysopen.t,222_system.t,223_truncate.t,225_utime.t,226_chdir.t,227_chmod.t,228_chown.t,229...
  - created by INABA Hitoshi

0.75  2011-06-05 00:00:00
  - remove Esjis::binmode and Esjis::open (it's a bad idea)
  - created by INABA Hitoshi

0.74  2011-06-01 00:00:00
  - remove Esjis::k_ test
  - fix s#foo#\\#, s#foo#\\#g, s'foo'\\', and s'foo'\\'g
  - created by INABA Hitoshi

MANIFEST  view on Meta::CPAN

t/UHC/200_sadahiro.t
t/UHC/201_kanji.t
t/UHC/202_kanji.t
t/UHC/203_kanji.t
t/UHC/204_kanji.t
t/UHC/205_glob.t
t/UHC/206_opendir.t
t/UHC/207_stat.t
t/UHC/208_filetest.t
t/UHC/209_grepdir.t
t/UHC/210_chmod.t
t/UHC/211_chown.t
t/UHC/212_dbmopen.t
t/UHC/213_do.t
t/UHC/214_glob.t
t/UHC/215_lstat.t
t/UHC/216_open.t
t/UHC/217_qx.t
t/UHC/218_rename.t
t/UHC/219_require.t
t/UHC/220_stat.t
t/UHC/221_sysopen.t
t/UHC/222_system.t
t/UHC/223_truncate.t
t/UHC/224_unlink.t
t/UHC/226_chdir.t
t/UHC/227_chmod.t
t/UHC/228_chown.t
t/UHC/229_glob.t
t/UHC/230_mkdir.t
t/UHC/231_opendir.t
t/UHC/232_qx.t
t/UHC/233_rename.t
t/UHC/234_rmdir.t
t/UHC/235_system.t
t/UHC/236_utime.t
t/UHC/237_filetest.t

lib/UHC.pm  view on Meta::CPAN

            CORE::eval q{ flock($fh, LOCK_EX) };
        }

        CORE::eval q{ truncate($fh, 0) };
        seek($fh, 0, 0) or die __FILE__, ": Can't seek file: $filename.e\n";

        my $e_script = UHC::escape_script($filename);
        print {$fh} $e_script;

        my $mode = (Euhc::stat($filename))[2] & 0777;
        chmod $mode, "$filename.e";

        close($fh) or die "Can't close file: $filename.e: $!";
    }

    my $fh = gensym();
    Euhc::_open_r($fh, "$filename.e") or die __FILE__, ": Can't read open file: $filename.e\n";

    if (0) {
    }
    elsif (exists $ENV{'CHAR_NONBLOCK'}) {

pmake.bat  view on Meta::CPAN

            }
        }

        if ($^O =~ /(?:solaris|linux)/i) {
            for my $file (@file) {
                if (-e $file) {
                    mkpath(dirname("$tardir/$file"), 0, 0777);
                    print STDERR "copy $file $tardir/$file\n";
                    copy($file, "$tardir/$file");
                    if ($file =~ m/ (?: Build\.PL | Makefile\.PL ) \z/oxmsi) {
                        chmod(0664, "$tardir/$file");
                    }
                    elsif ($file =~ m/\. (?: pl | bat | exe | com ) \z/oxmsi) {
                        chmod(0775, "$tardir/$file");
                    }
                    elsif ($file =~ m{^bin/}oxmsi) {
                        chmod(0775, "$tardir/$file");
                    }
                    else {
                        chmod(0664, "$tardir/$file");
                    }
                }
            }
            system(qq{tar -cvf $tardir.tar $tardir});
            system(qq{gzip $tardir.tar});
        }
        else {

#-----------------------------------------------------------------------------
# https://metacpan.org/search?q=Archive%3A%3ATar%3A%3AConstant

pmake.bat  view on Meta::CPAN

            print FH_TARBAT ":endofperl\n";
            close FH_TARBAT;
        }

        # make ptar
        else {
            open(FH_TARBAT, '>ptar') || die "Can't open file: ptar\n";
            print FH_TARBAT '#!', &which($^X), "\n";
            print FH_TARBAT $ptar;
            close FH_TARBAT;
            chmod 0755, 'ptar';
        }
    }
    elsif ($target =~ /^pwget(?:\.bat)?$/) {

        my $pwget = <<'PWGET_END';
######################################################################
#
# pwget - wget of Perl Poor Tools
#
# Copyright (c) 2011, 2018, 2019 INABA Hitoshi <ina@cpan.org> in a CPAN

pmake.bat  view on Meta::CPAN

            print FH_WGETBAT ":endofperl\n";
            close FH_WGETBAT;
        }

        # make pwget
        else {
            open(FH_WGETBAT, '>pwget') || die "Can't open file: pwget\n";
            print FH_WGETBAT '#!', &which($^X), "\n";
            print FH_WGETBAT $pwget;
            close FH_WGETBAT;
            chmod 0755, 'pwget';
        }
    }
    else {
        warn "unknown target: $target.\n";
    }
}

sub which {
    if ($_[0] =~ m#\A / #oxms) {
        return $_[0];

t/UHC/210_chmod.t  view on Meta::CPAN

}
if ($chcp !~ /932|949/oxms) {
    print "ok - 1 # SKIP $^X $0\n";
    exit;
}

open(FILE,'>F‹@”\') || die "Can't open file: F‹@”\\n";
print FILE "1\n";
close(FILE);

# chmod
if (chmod(0755,'F‹@”\') == 1) {
    print "ok - 1 chmod $^X $__FILE__\n";
}
else {
    print "not ok - 1 chmod: $! $^X $__FILE__\n";
}

unlink('F‹@”\');

__END__

t/UHC/227_chmod.t  view on Meta::CPAN

open(FILE,'>D‹@”\/file1.txt') || die "Can't open file: D‹@”\/file1.txt\n";
print FILE "1\n";
close(FILE);
open(FILE,'>D‹@”\/file2.txt') || die "Can't open file: D‹@”\/file2.txt\n";
print FILE "1\n";
close(FILE);
open(FILE,'>D‹@”\/file3.txt') || die "Can't open file: D‹@”\/file3.txt\n";
print FILE "1\n";
close(FILE);

# chmod
if (chmod(0755,'D‹@”\') == 1) {
    print "ok - 1 chmod $^X $__FILE__\n";
}
else {
    print "not ok - 1 chmod: $! $^X $__FILE__\n";
}

unlink('D‹@”\/file1.txt');
unlink('D‹@”\/file2.txt');
unlink('D‹@”\/file3.txt');
rmdir('directory');
rmdir('D‹@”\');

__END__



( run in 0.459 second using v1.01-cache-2.11-cpan-496ff517765 )