in reply to Re: Re: Having trouble with a Discussion Board
in thread Having trouble with a Discussion Board
the error message I got was: Can't open : No such file or directory at c:\webserver\osarr.org\www\cgi-bin\bb.pl line 67.
If you took my code (altered die statement) and pasted it in your script verbatim, than you experience something odd, for it doesn't return the value of the $tempfile variable in the die statement, alas, it looks like either you made a typo somewhere, or $tempfile is not set right. I take it this is a script you fetched from some online source, but if you're willing to improve it a little (call that a bunch) you might want to look into strict to prevent typos.
Looking at your original code again, I now notice (either I missed it before, or you changed it in the meanwhile) the following, which doesn't make much sense to me:
$bbfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bb.html"; $tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bb.html"; [...] rename("$bbfile", "$bbfile.old"); rename("$tempfile", "$bbfile");
This is not going to work. Both $bbfile and $tempfile point to the same file. The first rename function, changes bb.html into bb.html.old, leaving $tempfile clueless, for the file bb.html is gone. Try changing the value of $tempfile to something like:
$tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bb.html.tmp" +;
which is this line: $tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bbtemp.html";
No, the line number returned, will most likely point to:
open(TEMPFILE,">$tempfile") || die("Can't open $tempfile: $!");
That line contains the die statement that killed your script, if I recall correctly. I also wonder why the file in $tempfile is bbtemp.html now again. It doesn't show that in your original code, as discussed above.
I checked with the hosting co. and they said that the permissions are set read and write. Do I also need execute set on? Thanks What does this mean?
I'm not very familiar with the Windows file system, so other monks can probably explain this in greater detail, but if it's anything like a *NIX file system, you will need executable rights on all the directories leading to the file in question:
c:\webserver\ c:\webserver\osarr.org\ c:\webserver\osarr.org\www\ c:\webserver\osarr.org\www\member\ c:\webserver\osarr.org\www\member\bboard\
Then you need write access to the c:\webserver\osarr.org\www\member\bboard\ directory. Not the specific file, but the entire directory, for it seems that this script will recreate the $tempfile every time. Also make sure that the web-server is able to write to that directory, not just you, using your own account. The hosting company should know this and how to set it all up, so that's their burden ;) Also make sure these directories actually exist, and you didn't make a typo in them.
So, now back to the new error message (excuse me for the long post but I try to cover as much as possible) Can't open : No such file or directory at c:\webserver\osarr.org\www\cgi-bin\bb.pl line 67. Please triple check what line 67 exactly is and post that line specifically as you have it. The error you get looks to me like your code looks something like:
open(TEMPFILE, "$tempfile") || die("Can't open $tmpfile: $!");
Please not the > sign in my example, and check the spelling of the $tempfile in the die statement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Having trouble with a Discussion Board
by Ineedhelpplease (Novice) on Jan 29, 2004 at 15:35 UTC | |
by b10m (Vicar) on Jan 29, 2004 at 16:56 UTC |