H
himanshu.garg
Hello,
I have written the following script to simulate write failure
conditions in a real application.
open(FILE, ">test.txt");
#
# rm test.txt or chmod 000 test.txt, before the user gives input
#
my $input = <STDIN>;
print FILE "Hello, World!\n" or die "Couldn't write to file: $!\n";
close (FILE);
The problem is if I delete the file the program doesn't show any
error msg and the file remains deleted.
If I change the permissions to 000 the program is still able to
write to file even though the permissions remain 000.
Could you suggest, what it is that I am missing?
Thank You,
HG
I have written the following script to simulate write failure
conditions in a real application.
open(FILE, ">test.txt");
#
# rm test.txt or chmod 000 test.txt, before the user gives input
#
my $input = <STDIN>;
print FILE "Hello, World!\n" or die "Couldn't write to file: $!\n";
close (FILE);
The problem is if I delete the file the program doesn't show any
error msg and the file remains deleted.
If I change the permissions to 000 the program is still able to
write to file even though the permissions remain 000.
Could you suggest, what it is that I am missing?
Thank You,
HG