John,

I would try replacing what you have in the "name" attribute for CFEXECUTE
with this:

"/opt/coldfusionmx/wwwroot/DMS/receipts/print_form.pl > /dev/ttyS0"

or

"/opt/coldfusionmx/wwwroot/DMS/receipts/print_form.pl>/dev/ttyS0"

and then leave the "outputfile" attribute empty.  CFEXECUTE's outputfile
attribute might not behave in the same way as the command you're issuing
in the command shell.

If that doesn't work another option might be to use the Perl script itself
to talk directly to /dev/ttys0 instead of capturing the output of the
.pl file and writing it to the device.

-Cliff

On Wed, 04 Aug 2004 09:18:25 -0700 John Puzon <[EMAIL PROTECTED]> wrote:
>Hi.  I have a similar problem trying to make cfexecute work.  Hope
>I could find an answer and any answer is appreciated.   I have a
>simple executable script written in perl that I call using cfexecute.
> It is called by way of flash remoting using cffunction via cfc.
> The script is supposed to print directly to my serial receipt printer
>/dev/ttyS0.  A cash drawer is connected to this receipt printer that
>kicks off open.  The drawer kicks-off but the printer won't print.
> It just moves up one line and prints nothing.  I've already set
>the permission to 777 for the particular print_form.pl file.  I am
>able to print the print_form.pl in the command line using $ "print_form.pl>/dev/ttyS0".
> Here is a part of my cfc:
>
><cffunction hint="Update the Paid field upon confirmation of CA"
>     name="confirmCAReturns"
>            access="remote"
>            returnType="string">
>
>... a lot of other codes are here
>
>
>... This is where th action begins...
>
><!--- Kick off the drawer --->
><cfexecute name = "echo -e \020\024\001\000\001\005"
>           outputfile="/dev/ttyS0"
>    timeout = "1">
></cfexecute>
>
><!--- Write to a file that will be processed by the perl script
>for formatting--->
><cffile action=""> > file = "/opt/coldfusionmx/wwwroot/DMS/receipts/print_details"
> output = "#cfv_receipt#"
> mode = "777"
> charset = "US-ASCII"
> addnewline = "Yes">
>
>
><!--- Print receipt --->
>
><cfexecute name = "/opt/coldfusionmx/wwwroot/DMS/receipts/print_form.pl"
>    outputfile="/dev/ttyS0"
>    timeout = "1">
></cfexecute>
>
>
>...and so are here
>
></cffunction>
>
>I hope anyone of you could provide some answers for i'm really frustrated
>with this. I'm using the built-in webserver for coldfusion and Mandrake-

>10.
>
>Thanks in advance...
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to