Go to Post The real reason I am coming to IRI is to get that Paul Copioli, he will be bearhugged, if its the last thing I do :p - Mike Schroeder [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 Rating: Thread Rating: 8 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 19-01-2010, 18:11
davidalln's Avatar
davidalln davidalln is offline
World's Worst Coder
AKA: David Allen
FRC #2415 (The Westminster Wiredcats)
Team Role: Programmer
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Atlanta, GA
Posts: 108
davidalln is on a distinguished road
Send a message via AIM to davidalln
Re: ofstream (standard C++ file output) not working

Did you or anyone else successfully get a log running on their cRio? We are trying to do something similar, and we have had consistent success with creating the file but very spotty success when writing to it (depending on where the lines are added in the code). Sometimes it works sometimes it doesn't.
__________________
SANTOSH ANDREW DECKER RICK WYNNIE SEAN DEREK MATT
(alamo (semis), p'tree (CHAMPS!), nc (CHAMPS!), newton (quarters))


Best four years of my life. Thanks to everyone who made it happen.
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2010, 14:37
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: ofstream (standard C++ file output) not working

I know this is quite a bump, but now I'm even having problems using C file I/O with FILE* pointers. I've called Priv_SetWriteAllowed(1) and still weird stuff happens. Sometimes things work fine, but there's a boat load of issues most of the time:
  • While some files write fine, others don't write at all, and still others write nothing but whitespace.
  • fwrite() reformats strings for some bizarre reason. Example: I wanted to print some formatted data into a .csv (comma seperated value) file. I used sprintf() to print some floats with some commas, carraige returns, and line feeds. Calling printf() on the string created with sprintf() yields what I would expect, but when I write the exact same string to the file with fwrite(), every float is smaller by two orders of magnitude.

Does anybody have any idea what could be causing this? It's making things very difficult and I can't imagine why it would be happening.
__________________

Last edited by slavik262 : 25-01-2010 at 19:47.
Reply With Quote
  #3   Spotlight this post!  
Unread 25-01-2010, 22:16
TheDominis TheDominis is offline
Registered User
FRC #2152
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
TheDominis has a spectacular aura aboutTheDominis has a spectacular aura about
Re: ofstream (standard C++ file output) not working

I've found that some parts of the STL do not work with well/at all Wind River. I tried to use std::fstream to store some packet data, but had to use c-style file I/O for it to work.
Reply With Quote
  #4   Spotlight this post!  
Unread 26-01-2010, 00:15
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: ofstream (standard C++ file output) not working

Quote:
Originally Posted by TheDominis View Post
I've found that some parts of the STL do not work with well/at all Wind River. I tried to use std::fstream to store some packet data, but had to use c-style file I/O for it to work.
C-style file I/O isn't working for me at all either...
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 26-01-2010, 13:35
TheDominis TheDominis is offline
Registered User
FRC #2152
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
TheDominis has a spectacular aura aboutTheDominis has a spectacular aura about
Re: ofstream (standard C++ file output) not working

Quote:
Originally Posted by slavik262 View Post
C-style file I/O isn't working for me at all either...
Interesting. What permissions are you using? I used "w".
Reply With Quote
  #6   Spotlight this post!  
Unread 26-01-2010, 16:37
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: ofstream (standard C++ file output) not working

I was using w. I guess I could try wb or w+, but I was just writing text...
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
p2 not working? Lone_Wolf92c Programming 5 22-02-2008 08:49
IR Board Not Working (But NOT Fried) itsme Electrical 2 18-02-2008 06:11
Beware - transmission output shaft is not 5/8"! jskene Kit & Additional Hardware 30 13-02-2006 14:01
Drive() Not a Standard Toolset in EasyC? Chris_Elston Programming 3 08-02-2006 09:01
Beware - transmission output shaft is not 5/8"! jskene Technical Discussion 3 19-01-2006 14:24


All times are GMT -5. The time now is 12:31.

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