#! / usr / bin / perl -w
OpenDIR awir, "."; @ filename = readdir; # print join ("/ n", @FileName); Foreach $ fname (@filename) {if ($ fname = ~ / 帖子) {Next } My $ tmpfilename = "$ fname.tmp.tmp.tmp"; Open srcfile, "<$ fname"; Open TMPFILE, "> $ TMPFILENAME"; WHILE
)
{
IF ($ _ = ~ / ^(./R/N)
{
Print TmpFile $ 1. "/ n";
}
Else
{
Print tmpfile $ _;
}
}
Close Srcfile;
Close tmpfile;
My @filestatus = stat ($ fname);
CHMOD ($ FILESTATUS [2], $ TMPFILENAME);
Chown ($ FILESTATUS [4], $ FILESTATUS [5], $ TMPFILENAME);
# Delete Srcfile
Unlink ($ fname);
`MV $ TMPFILENAME $ FNAME`;
}
`rm * .tmp.tmp.tmp`;
CloseDir (TwId);