• Post Reply Bookmark Topic Watch Topic
  • New Topic

device read under linux

 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We make custom hardware and we have a singleboard PC built in with our hardware. We have had a device driver built to talk to our side of the hardware. The driver guy was wondering if we could actually use the file I/O (or maybe channels) functions under java to access the info provided by the driver instead of haveing to use a JNI library written in C++ . We are doing this under linux so the "file" would be /dev/ourdevice. Does anyone know if this has any chance to work? Does java block "file" changes when it has the file open for reading or is that a system thing? I know java, but I haven't worked with file I/O much and I don't know linux very well.
Does file I/O under linux behave the same way as device I/O? Do they both use lseek(),read() kind of commands internally or is file I/O totally different under the hood?
Am I barking up the wrong tree just because it smells good?
Just trying to save some time and money. Thanks for any help.
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,
It's difficult to say whether it will work or not. I would think that the best shot would be with a FileChannel. It wouldn't take but a few lines of code to see whether you're barkin' up the wrong tree or not.
Michael Morris
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K thanks, I may give that a try if I get a few moments to work on it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!