View Single Post
  #6   Spotlight this post!  
Unread 04-02-2015, 10:56
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,575
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Text files on the roborio?

Quote:
Originally Posted by 2B || !2B View Post
Thank you so much!
I guess ~/ only works in desktop linux.....
The ~ is normally interpreted by the shell, not the kernel. I believe that java is attempting to open the file directly through an fopen() or equivalent call. I believe that you can get the value of the HOME environment variable and use it in place of the ~ to avoid hardcoding paths.

Code:
.
.
        Map<String, String> env = System.getenv();
.
.
        f = new File(env.get("HOME") + "/Output.txt");
.
.
Reply With Quote