I tried doing the following:
2 calls to "open".
lseek on each file descriptor.
After the 2 lseek calls, "read" on each file descriptor.

Each read returned data from the correct location, so I think that lseek
must be modifying some state on a per-fd basis.

The problem that I have is not with the offset, but with the number of
bytes read with a single call to "read".  Anything over 4096 bytes
produces EINVAL.  This is easy enough for me to work around by dividing
large reads into smaller chunks.

Rod

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul
Alfille
Sent: Monday, May 22, 2006 10:03 AM
To: [email protected]
Subject: Re: [Owfs-developers] RE: problem writing to DS1996

Yup, I see the problem, but not necessarily the solution.

Right now, "open" is a null op. Each read "opens" the file, reads, and
closes. Since we aren't talking about real files, this makes sense,
and means we don't have to rememver state information, and pair
opening and closing. Since most 1-wire devices have such little
memory, it made little sense to read in more than a single gulp.

So the file descriptor returned by open is ignored, I don't know what
the lseek does, and the next read reads from the start.

What we really need is a "read" that includes offset.

Could you use "owcapi"? It's a C library that acts as an intermediary
to owlib. It could easily  include a "read" with offset, since offset
is handled internally by owlib.

Paul

On 5/22/06, Spade, Rod <[EMAIL PROTECTED]> wrote:
> Paul,
>
> I can also do cat or cp with no problems.  The source code that gives
me
> EINVAL is below.
>
> Thanks for your support!
>
> Rod


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to