jrbush82 has asked for the wisdom of the Perl Monks concerning the following question:
It works when auth is set to 1 because it just creates a file for each post. When it is set to 0, I am appending information to a file. During the first post, it works fine, after that, I can't post to it or nothing, it just hangs. I have tried the script with >>, +<, >+, and +>>. Any ideas on why this doesn't work after the first post? I have also tried running chmod as it is commented out above. Thanks, Jason Bush# 0 to go directly to the web, or 1 to authorize first $auth = 0; if ($auth == 0) { LINE: for ($i=0; defined($i); $i++){ unless (-e "./data/$month.dat") { open (FILE, "+>>./data/$month.dat"); flock(FILE,2) or next LINE; print FILE "$event\|$month $day $year\|$place\|$addr\|$desc\|$contact\ +|$phone\|$county\|"; close FILE; last LINE; } } # Tried to add this to get access to file, but didn't work # chmod 0666, "./data/$month.dat"; }elsif ($auth == 1){ LINE: for ($i=0; defined($i); $i++){ unless (-e "./tempevents/$i.dat") { open (FILE, ">./tempevents/$i.dat"); flock(FILE,2) or next LINE; print FILE "$event\|$month $day $year\|$place\|$addr\|$desc\|$contact\ +|$phone\|$county\|"; close FILE; last LINE; } } } # End
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File not responding after first append
by dws (Chancellor) on Nov 27, 2001 at 23:59 UTC | |
|
Re: File not responding after first append
by Dogma (Pilgrim) on Nov 28, 2001 at 00:20 UTC | |
|
Re: File not responding after first append
by impossiblerobot (Deacon) on Nov 28, 2001 at 01:58 UTC | |
|
Re: File not responding after first append
by Gerryjun (Scribe) on Nov 28, 2001 at 00:05 UTC | |
by Fastolfe (Vicar) on Nov 28, 2001 at 00:31 UTC |