High level hardware access

John van Groningen johnvg@cs.kun.nl
Wed, 24 May 2000 16:28:36 +0200


Alcimar Soares wrote:

>...
>Rd file i ac
># ok = sfend file
>|  ok = Rd file i ac
>|  i == 4 = (ac, file)
># (ok, c, file) = sfreadc file
>= Rd file (i=1) [c:ac]
>
>AND... guess what? IT doesn't work....
>
>Whenever we try to run, the answer is:
>
>    "sFOpen: seek to end of file failed"

The file open functions of Clean try to determine the length of the file by seeking to the end of the file and back again. This obviously fails for some special files like /dev/ttyS0. I don't think there is a workaround for the current implementation.

>As I said above, we have already done it in low level.... But we would
>like to treat ports like files... a much more cute approach... Is that
>possible? If so what should we do?

Use htoclean to write an interface to the c functions fopen, fgetc and fclose, or may be to open, read and close.

>And finally ... ( you thought that was all??? ... NOP) ... Does anyone
>have an idea of where we can find a documentation about the "clm command
>line flags" FOR LINUX????

There should be man page for clm, in a folder called man. If you add this directory to you MANPATH, and type 'man clm' you should see the manual for clm.

Best regards,

John