Sure no problem. Glad I could help.
It is possible that there is a mount option (man mount) in FILESYSTEM INDEPENDENT MOUNT OPTIONS which may help sshfs however I tried -o dev,atime without any luck either. I think after the write or the "echo -ne" you need to (lseek) the file pointer back to 0 then it will be okay? The file size is correct in the beginning because it is set from proc initialization code in kernel/mkd.c and kernel/borph.c which use the structure described here http://www.6test.edu.cn/~lujx/linux_networking/0131777203_ch02lev1sec8.html Also the offsets and sizes are stored in the bof header in the bof elf file. I guess to keep it working program the bof then open all the registers and hold the file descriptors and read / write at will then before closing seek the file descriptors back to zero. This might keep sshfs happy! You could also try an ssh port forward to the katcp port *ssh -vNL 7147:roach:7147 gateway* Then use the katcp interface to read / write the registers. There is a katcp_wrapper.py in the corr library Regards Adam On Wed, Aug 29, 2012 at 1:58 AM, Tom Kuiper <[email protected]> wrote: > ** > On 08/28/2012 04:45 PM, Adam Barta wrote: > > Thanks > > Okay looks like the culprit is *sshfs* I tried it my side and it seems to > fail when using it that way. I guess the problem is that *fuse* just wont > let you read a zero byte file. > > I never thought of that! Thanks. There's Glenn's approach which is a bit > more complex. > > It might be possible to trick fuse by making a character device. (mknod or > mkfifo) > > I suspect that given the learning curve that would involve for me, pyro > will be the way to go. > > Thanks for helping me track it down. > > Out of curiosity, do you know why the files sizes are correct at the > beginning and don't stay that way? > > Tom > > > > Adam > > > > On Wed, Aug 29, 2012 at 1:36 AM, Tom Kuiper <[email protected]> wrote: > >> On 08/28/2012 04:24 PM, Adam Barta wrote: >> >> Could you share a code snippet? >> >> Here's the code. >> >> If you cat the file to hd does it read correctly even with the zero >> filesize? >> >> I'll have to make a small mod before trying that. I'll let you know. >> >> >> Tom >> >> >> >> >> >> On Wed, Aug 29, 2012 at 1:19 AM, Tom Kuiper <[email protected]> wrote: >> >>> On 08/28/2012 04:11 PM, Adam Barta wrote: >>> >>> is it possible that ipython is not actually closing the file but keeping >>> the file descriptor open behind your back, if so then seeking to 0 might >>> solve it? >>> >>> Clever idea! but, alas, Python is cleverer than that. I put a seek(0) >>> after (re)opening the file and before reading. Still get 0 bytes back. >>> >>> I'm not having much luck in finding a way to change the file size. >>> There is a 'truncate' method that will do it but Linux will zero fill an >>> extended file. >>> >>> Cheers >>> >>> Tom >>> >>> >>> >>> >>> On Wed, Aug 29, 2012 at 1:00 AM, Tom Kuiper <[email protected]> wrote: >>> >>>> On 08/28/2012 03:54 PM, David MacMahon wrote: >>>> >>>>> On Aug 28, 2012, at 3:39 PM, Tom Kuiper wrote: >>>>> >>>>> >>>>>> I don't know how to get Python to read more than teh nominal file >>>>>> size if it is supposed to look like a file. >>>>>> >>>>>> >>>>> If you want to read the register value a second time, you need to seek >>>>> to the beginning of the file first, then read four bytes. You should be >>>>> able to repeat the seek/read pattern as many times as you want. >>>>> >>>>> >>>> I close the file after I write to it and open it again for the read. >>>> After I write to the file, "ls -l" gives a size of zero instead of 4. >>>> >>>> If that's not what's confusing you, can you please clarify what is? >>>>> >>>> I am not trying to mix reads and writes on an open file. I know about >>>> seek and tell if that were what I wanted to do. >>>> >>>> Tom >>>> >>>> >>> >>> >>> -- >>> *Adam Barta* >>> c: +27 72 105 8611 <%2B27%2072%20105%208611> >>> e: [email protected] >>> w: www.ska.ac.za >>> >>> >>> >>> >>> -- >>> I or me? http://www.oxforddictionaries.com/page/145 >>> >>> >> >> >> -- >> *Adam Barta* >> c: +27 72 105 8611 <%2B27%2072%20105%208611> >> e: [email protected] >> w: www.ska.ac.za >> >> >> >> >> -- >> I or me? http://www.oxforddictionaries.com/page/145 >> >> > > > -- > *Adam Barta* > c: +27 72 105 8611 > e: [email protected] > w: www.ska.ac.za > > > > > -- > I or me? http://www.oxforddictionaries.com/page/145 > > -- *Adam Barta* c: +27 72 105 8611 e: [email protected] w: www.ska.ac.za

