transfer text file to lpt1 port

Hello,

I'm new ruby developer, any idea about : send text file to lpt1 port
where i have installed an intermec printer?

Are you trying to do this on the client PC or on the server? If on
the server you can call out to the OS using system() so presumably you
could do it that way.

Colin

Colin Law wrote in post #1074484:

Did you try looking at the ruby documentation? This for example
http://ruby-doc.org/core-1.9.3/Kernel.html#method-i-system

Colin

Thanks, but i want send text file from server to client (lpt1 port),
it's possible?

Hi,

You said, in response to Colin’s question, that you wanted to send it to lpt1 port on the server. Now you’re saying that it is to be sent to the lpt1 port on the client?

This would not be possible via HTTP, the server cannot take control of the client. The best you could achieve (IMHO) is to render the text file to the browser, and use JavaScript to open the browser’s print dialogue.

If this is a Ruby question rather than a Rails question, then you would need to write a server and a client application with the client requesting the file from the server using a standard (or your own proprietary) protocol, once the received it [the client] could open the port and send the received text file to it.

I hope that this helps.

All the best,

Steve

You said, in response to Colin’s question, that you wanted to send it to lpt1 port on the server. Now you’re saying that it is to be sent to the lpt1 port on the client?

You never said that, I misread it - lol, sorry.

Steve

This seems to come up every couple months - check out this thread from January for some discussion:

https://groups.google.com/d/topic/rubyonrails-talk/fUMJxKOIaE8/discussion

Not sure if the final method there (using jzebra) will work for your app, but it seems like a good start.

–Matt Jones