Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm getting the following error:

CGIWrap encountered an error while attempting to execute this script: Error Message: Text file busy Error Number: 26

The problem is, I'm not doing anything with text files. The code runs fine on my system, and did run fine on the remote system until a minute ago. Is there another common reason for this error (ie resource usage cut?)? Thanks.

Replies are listed 'Best First'.
Re: Text File Busy - or not?
by chip (Curate) on Jun 26, 2003 at 15:44 UTC
    "Text file" is old Unix-speak for an executable; specifically, the "text" portion of such a file is the executable code. So apparently somebody is trying to open a file for writing while it's being executed. This is a Bad Thing.

    PS: Opening a perl script during execution can't cause this error. It must be a binary executable.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

Re: Text File Busy - or not?
by cbro (Pilgrim) on Jun 26, 2003 at 15:51 UTC
    Doing a google search for, "CGIWrap error text file busy", I found:
    This message usually indicates there is a problem with the script itself. Often this indicates either that the #! line of the script is incorrect, or the script was uploaded in binary mode instead of ascii mode. Check to make sure that the script does not have control-M's at the end of every line. This is typically a problem if the script was edited or uploaded from a DOS/Windows/Macintosh station to a unix based server.
    HTH,
    Chris
      It helps a lot if you have shell access to the machine where the script resides. If you do then:

      To see if you have extra line end characters:
       vi <script name>
      you'll see a ^M at the end of each line. To quit vi:
       <esc>:q!

      To fix this (on many unix flavors):
       dos2unix <script name> <script name>

      Uploading the file in "text" mode in some ftp clients will automatically convert the line enders for you when performing an upload/download. Note that some ftp clients DON'T do this, YMMV. Binary mode is /Absolutely Necessary/ if you uploading gifs, jpgs, etc. Some ftp clients have an "automatic mode" which will use what it thinks is the right mode depending on the file extension. Again, YMMV. Cheers

      -------------------------------------
      Nothing is too wonderful to be true
      -- Michael Faraday