# ulpt0 vs. unlpt0



## Bill Evans at Mariposa (Feb 9, 2015)

So I'm playing with 10.1-RELEASE, and while it's running I plug in a USB printer. Two new devices appear: /dev/ulpt0 and /dev/unlpt0. My situation is simple; I'm not going to use lpr or CUPS or anything like that. I can cat data to either device, and it comes out just fine (other than the stairstep problem). My main question is this: What's the difference between using /dev/ulpt0 and using /dev/unlpt0?

A supplemental question: I haven't been able to find on the base 10-RELEASE system any filter like todos or unix2dos to add carriage returns before line feeds to eliminate the stairstep problem. I could write a trivial filter to do this, but I'd feel foolish doing so if it turned out that FreeBSD had a package that included a program that would do this for me. Is there such?


----------



## junovitch@ (Feb 9, 2015)

Excerpt from ulpt(4)


> ...
> FILES
> /dev/ulpt?   device with reset
> /dev/unlpt?  device without reset
> ...



unix2dos is available as a port, converters/unix2dos, so you can just run `pkg install unix2dos`.


----------



## Oko (Feb 9, 2015)

Bill Evans at Mariposa said:


> A supplemental question: I haven't been able to find on the base 10-RELEASE system any filter like todos or unix2dos to add carriage returns before line feeds to eliminate the stairstep problem. I could write a trivial filter to do this, but I'd feel foolish doing so if it turned out that FreeBSD had a package that included a program that would do this for me. Is there such?




```
#!/bin/sh
       FILE=${SRC}
       tr -d '\r' < ${FILE} > aux
       mv aux ${FILE}
```


----------



## wblock@ (Feb 9, 2015)

/dev/ulpt0 is reset then opened, /dev/unlpt0 is just opened.  This makes a difference on many printers that are still busy doing the reset when data arrives.  If your printer works both ways, it does not matter which you use.

Oko: I thought the canonical solution was `col -b`.


----------

