Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Default working directory for FRCUserProgram process? (http://www.chiefdelphi.com/forums/showthread.php?t=135860)

lalondma 03-17-2015 09:38 AM

Default working directory for FRCUserProgram process?
 
Hello,
Recently, I got a program crash because the text file that was supposed to be loaded by AutomonousInit (C++ - iterative robot) could not be found. The file was placed in /home/lvuser alongside the binary FRCUserProgram, so I expected a call like fopen("foo.txt","r") to work but it didn't. fopen("/home/lvuser/foo.txt","r") did work however, so it's not a permission issue. Also tried to put the file in "/home/admin" in case FRCUserProgram would run as admin, without success. Anybody knows what the default working directory is? "/", maybe?

connor.worley 03-17-2015 12:59 PM

Re: Default working directory for FRCUserProgram process?
 
http://linux.die.net/man/3/getcwd

Test and share results?

lalondma 03-18-2015 05:53 PM

Re: Default working directory for FRCUserProgram process?
 
Indeed, got it with getcwd (thanks for the tip):

/usr/local/natinst/labview

Not especially intuitive...

jhersh 03-19-2015 11:46 PM

Re: Default working directory for FRCUserProgram process?
 
Quote:

Originally Posted by lalondma (Post 1459565)
Indeed, got it with getcwd (thanks for the tip):

/usr/local/natinst/labview

Not especially intuitive...

Sorry about that. I'll fix it for next season if you'll file a tracker at https://usfirst.collab.net/sf/tracke...cker.4_defects

kylelanman 03-20-2015 12:10 AM

Re: Default working directory for FRCUserProgram process?
 
We ran into a similar issue. Our findings indicated that the working directory was different when running while debugging and running when deployed. The quick fix for us was to use the entire path: /home/lvuser/Encoder_Offsets.txt.


All times are GMT -5. The time now is 10:44 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi