Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem accessing /dev/lp0

Status
Not open for further replies.

Breadcrust

Programmer
Oct 27, 2003
42
AU
im trying to make a program i can interface with devices on the paralell port (on linux) with :

---------------------------------

proc sendtext {newline} {
global outtext

global port



if {$newline} {

set sendtext "$outtext\n"

} else {
set sendtext $outtext

}

.text insert end $sendtext



puts -nonewline $port $sendtext

}


proc readtext {} {

global port

.text insert end [read "$port"]

after idle readtext
}

text .text

frame .control
entry .control.text -textvariable outtext

button .control.send -text "Send" -command {sendtext false}
button .control.sendnl -text "Send (\\n)" -command {sendtext true}
button .control.recieve -text "Start Recieving" -command {
.control.recieve configure -state disabled
readtext
}

pack .text -fill both -expand true
pack .control -fill x
pack .control.text -fill both -expand true -side left
pack .control.send -fill y -side right
pack .control.sendnl -fill y -side right
pack .control.recieve -fill y -side right

set port [open /dev/lp0 r+]

-------------------------------------------------------

the problem is, when i try to start receiving stuff from the paralell port it comes up with cannot read from file4: i/o error. what am i doing wrong?

Breadcrust (aka J@red)

Web - E-mail - net-head@softhome.net
Linux Reg. Number - 307180
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top