Go to Post Because the new control system weights as much as a fully-loaded M1 Abrams Tank. - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-03-2015, 09:38
lalondma lalondma is offline
Registered User
AKA: Marc Lalonde
FRC #3990 (Tech for Kids)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Montreal
Posts: 5
lalondma is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 17-03-2015, 12:59
connor.worley's Avatar
connor.worley connor.worley is offline
Registered User
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2010
Location: Berkeley/San Diego
Posts: 601
connor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond repute
Re: Default working directory for FRCUserProgram process?

http://linux.die.net/man/3/getcwd

Test and share results?
__________________
Team 973 (2016-???)
Team 5499 (2015-2016)
Team 254 (2014-2015)

Team 1538 (2011-2014)
2014 Driver (25W 17L 1T)
日本語でOK
Reply With Quote
  #3   Spotlight this post!  
Unread 18-03-2015, 17:53
lalondma lalondma is offline
Registered User
AKA: Marc Lalonde
FRC #3990 (Tech for Kids)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Montreal
Posts: 5
lalondma is an unknown quantity at this point
Re: Default working directory for FRCUserProgram process?

Indeed, got it with getcwd (thanks for the tip):

/usr/local/natinst/labview

Not especially intuitive...
Reply With Quote
  #4   Spotlight this post!  
Unread 19-03-2015, 23:46
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Default working directory for FRCUserProgram process?

Quote:
Originally Posted by lalondma View Post
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
Reply With Quote
  #5   Spotlight this post!  
Unread 20-03-2015, 00:10
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 186
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
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.
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:00.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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