Edit two files?
I want to open and edit two files in the same action. (or one right after the other). For some reason perl only allows me to edit the first one. Does anyone know why this may be? My code looks like:
open (guest, ">>book.file") || die "Cannot open file: $!\n";
flock(guest,2);
print guest "$entryline";
unlock(guest);
close (guest);
open(count, "counter.file")|| die "Cannot open file: $!\n";
$count=;
close(count);
$count++;
open(count, ">counter.file") || die "cannot open file: $!\n";
flock(count,2);
print count "$count";
unlock(count);
close(count);
Thanks!
Laguna Loire
Site Director: Laguna's Jukebox (http://jukebox.3dstream.net)
Site Admin: RPGBoards (http://rpgboards.3dstream.net)
Orpheus posted this at 23:45 — 5th August 2000.
They have: 568 posts
Joined: Nov 1999
I see you started to post outside of the RPG Boards.
Is the second file chmoded 777?
Laguna Loire posted this at 00:50 — 6th August 2000.
They have: 45 posts
Joined: Aug 2000
Our server dosnt require cmoding to execute cgi scripts or edit files. The first file was never cmoded, however it edited it.
I do post outside, on SEVERAL message boards!
Laguna Loire
Site Director: Laguna's Jukebox (http://jukebox.3dstream.net)
Site Admin: RPGBoards (http://rpgboards.3dstream.net)
richjb posted this at 05:24 — 6th August 2000.
They have: 193 posts
Joined: Feb 2000
Remove the unlock commands...I am suprised PERL isn't giving you a 500 Error: unlock is a delete command, not the reverse of flock.
Richard
Orpheus posted this at 07:15 — 6th August 2000.
They have: 568 posts
Joined: Nov 1999
richjb, your confused. unlock is the right way to unlock the file. unLINK is the delete command.
richjb posted this at 17:59 — 6th August 2000.
They have: 193 posts
Joined: Feb 2000
You're right.
Richard
Orpheus posted this at 18:29 — 7th August 2000.
They have: 568 posts
Joined: Nov 1999
if your server doesn't support chmoding then chances are it wont support flock.
are you talking about the 3dstream server?
Laguna Loire posted this at 01:04 — 8th August 2000.
They have: 45 posts
Joined: Aug 2000
It supports cmoding, however I dont have too to run a perl script. I have cmoded files before to remove outside access to them. And yes, this is the 3dstream server
Laguna Loire
Site Director: Laguna's Jukebox (http://jukebox.3dstream.net)
Site Admin: RPGBoards (http://rpgboards.3dstream.net)
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.