을 닫은 후
읽기 A_Copy.txt을 닫기 전에 반드시 충분히해야한다 이전 파일을 읽을 수 있고 새 파일을 쓸 수 있고 읽을 수있는 경우 복사가 매우 잘 수행됩니다. 는 파일을 읽을 경우 가장 좋은 방법은 ..와 -r``사용하여 파일을 읽을 수 있는지 여부를 알고 싶어하거나하지 않으면 시스템 합계 전화
#!/usr/bin/perl
use File::Copy;
use Tie::File;
my $i = "A.txt"; # input file
my $o = "A_Copy.txt"; # output file
my @a; # array to use with tie
copy($i, $o) or die;
# check that the new file is readable, actually unneeded since copy
# would fail on any error
die unless (-r $o);
# fill an array with the lines of the new file
tie @a, "Tie::File", $o or die;
# change the first line of the new file
$a[0] = "Hi";
을 사용하는 -r을 사용하는 것입니다 확인하려면 당신' 파일'.. 당신이 뭔가하고 싶다면 .. 우리에게 몇 가지 코드를 보여주세요 .. –