in reply to Re: Having trouble with a Discussion Board
in thread Having trouble with a Discussion Board

Thank you - I changed it and 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. which is this line: $tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bbtemp.html"; 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?
  • Comment on Re: Re: Having trouble with a Discussion Board

Replies are listed 'Best First'.
Re: Having trouble with a Discussion Board
by b10m (Vicar) on Jan 29, 2004 at 02:12 UTC
    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.

    --
    b10m

    All code is usually tested, but rarely trusted.
      Hi - I realized a posted an error on the original code that I sent you but have since fixed it and am still not getting this thing to work. The setting of $tempfile statement should read: $tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bbtemp.html"; Also, line 67 in my code reads as: open(TEMPFILE,">$tempfile") || die ("Can't open $tempfile: $!"); Again, I appreciate your help in this. As you probably know, I am not a perl expert and if you have any suggestions or a better and easier script for a simple discussion board, I would love to hear about them. Thank you again.

        You give little info of what error you now get, and without seeing the entire source of the script as it is now (probably after many alterations), I think it's close to madness to try and guess what the solution might be.

        if you have any suggestions or a better and easier script for a simple discussion board, I would love to hear about them.

        I bet you can find a nice one on sites such as http://www.hotscripts.com/, but as always, you Google is usually a big help too.

        --
        b10m

        All code is usually tested, but rarely trusted.