星期五, 十月 24, 2008

MYSQL --Repair Tables

http://dev.mysql.com/doc/refman/5.0/en/repair.html

Symptoms of corrupted tables include queries that abort unexpectedly and observable errors such as these:

  • tbl_name.frm is locked against change

  • Can't find file tbl_name.MYI (Errcode: nnn)

  • Unexpected end of file

  • Record file is crashed

  • Got error nnn from table handler

To get more information about the error, run perror nnn, where nnn is the error number.


perror - describes a system or MySQL error code. 

Can  be  used  to  display a description for a system error code, or an MyISAM/ISAM table handler error code. The  error  messages  are  mostly system dependent

星期三, 十月 01, 2008

linux下 ls -l返回结果的处理正规表达式

sub print_file {

    my($ftp, $dir) = @_;

    my @files = $ftp->dir()

        or warn "Can't LIST: ", $ftp->message;

    return unless @files;

 

    print "into $dir¥n";

 

    for (@files) {

        s/¥r//g;

        s/¥n//g;

        if (/

            ^

            (.|-)                   # (1) type

            (.{9})                  # (2) permittion

            ¥s+

            (¥d+)                   # (3) links

            ¥s+

            (¥w+)                   # (4) owner

            ¥s+

            (¥w+)                   # (5) group

            ¥s+

            (¥d+)                   # (6) size           

            ¥s+

            (¥w{3}¥s+¥d+¥s+¥d+:¥d+) # (7) date

            ¥s+

            (.*?)                   # (8) filename

            (?:¥s+->¥s+(.*))?       # (9) link

            $

            /x)

        {

            print "$dir/$8  $6  $7";

            if ($1 eq 'd') {

                my $next_dir = File::Spec->catfile($dir, $8);

                $ftp->cwd($8);

                &print_file($tree, $ftp, $next_dir);

                $ftp->cdup();

            }

        }

    }

}

Perl FTP 相关module


Net::FTP::File - Perl extension for simplifying FTP file operations


Net::xFTP - Common wrapper functions for use with either Net::FTP or Net::xFTP