Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-09-2009, 02:48 PM   #1
LQ Newbie
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
C code to use existing printer


I did C code to print strings over one printer. I used "fopen" and "fputs" to write through the parallel port.

FILE * stream = fopen ("/dev/lp0", "w");
fputs (MY_STRING, stream;

Now, I installed a new printer via USB. The printer installed itself and I can see it in my printer list (OS: openSUSE 10.2)

1. Can I use the same functions (see above) that I used to work with my USB printer?

2. If I can use the same functions, how can I know which usb port my printer uses. I did a "lsusb". I can see that my printer is located to Bus 003 Device 002. I read that usb printer are located in /dev/usb. I then used /dev/usb/lp0, but seems not working. Am I ok with that?

3. If I cannot use the same functions, what should I use to be able to send my data via the USB driver?

Thanks in advance.

Last edited by icarus_31; 10-09-2009 at 02:54 PM.
Old 10-09-2009, 03:02 PM   #2
Registered: Mar 2005
Posts: 130

Rep: Reputation: 17
No, lp0 is strictly the parallel port. Can't help you with the usb stuff, sorry.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printer troubles - I can't delete my existing printer BobNutfield Slackware 1 04-15-2009 02:28 PM
Help administering cups printer: adding Acer Limpus netbook to existing network stevemid Linux - Software 2 09-27-2008 11:03 PM
HP printer error code 2 Larry Webb Linux - Hardware 6 10-18-2007 04:53 PM
Using iproute2 existing code for my application kky Programming 1 10-12-2007 03:05 PM
Eclipse w/CDT plugin - importing existing sorce code kenneho Programming 0 10-29-2005 06:44 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration