Java - Can't access files on RoboRIO

I put trajectory CSV’s in my deploy folder and uploaded the files to the RoboRIO under /home/lvuser/deploy. I can see the files with SSH. However, when I try to access the file using new File("/home/lvuser/deploy/trajectory.csv");, it gives me a SIGFAULT.

If the path is wrong, it just raises a FileNotFoundException. But when the path is right, it crashes with a sigfault.

Can you post the exact text of the full stack trace? And/or, a link to the code on github (or similar)?

Do the two types of errors you mention come from the exact same line? You mention “access”, but I’m not ensure if this involves the file open or file read operation.

How big is the file? Were there any errors during the deploy of the code? Does rebooting the roboRIO happen to fix the issue? (curious if perhaps another program still is holding the file handle and not allowing other programs to access it).

I can post the stack trace this evening. The code is just this:

File file = new File("/home/lvuser/deploy/trajectory.csv");

They come from the exact same line. I’m not sure if it’s file open or file read, maybe both? The file is 2KB. No errors during deployment, and I haven’t tried rebooting the roboRIO. I’ll do more experimentation tonight.

Is that really the only line that you have that accesses the file? I would have expected additional code that does something.

It is. I disabled all the other lines. I have the file read in robotInit().

Ok, thanks. Best of luck with the experiments tonight!

FYI - Just that single line should do an open operation. Java tells the OS that “yes, I want to eventually read/write to this file”. The actual reading/writing is done by calling methods from the file object.

The problem was Pathfinder…the CSV was invalid. My bad! Thanks for the help anyway.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.