Hi,
It seems pretty easy to unlink a file from a directory, but wherever describes unlinking file has no counterpart on create a file. I did perldoc -q file: got what seemed to be what I need, then tested my program, no good:
opendir PDB,"SCRATCH" or die "cannot open the SCRATCH dir:$!";
my @GG=grep{!/^./ && !/^../} readdir(PDB); #to store all the file names in the 
array @GG
my $NN=scalar (@GG+1);
$filenamie="PDB_$NN.txt";
open LOO,">>SCRATCH/$filenamie" or die "cannot open the SCRATCH/$filenamie:$!";
sysopen(LOO, "SCRATCH/$filenamie", O_WRONLY|O_TRUNC|O_CREAT)        || die $!;
sysopen(LOO, "SCRATCH/$filenamie", O_WRONLY|O_TRUNC|O_CREAT, 0666)  || die $!;
select LOO;
print "linking was successful!";


This didn't work.
What was wrong?
thanks a lot.

best,

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to