![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
Tailing a file?
There is a program I am working with that, attached to an external instrument, writes cryptic data to file for a few days. This data file is then run through another program which extracts the numeric data and writes it to an Excel file. If the numbers in this file are all within a certain range, the external instrument passed the test.
While the program is generating the data file (which takes a long, long time), I need to read the data that is being produced and stop the test if it has failed. What is the "safest" way to do this? I am on a Windows machine, so I assume there is no "tail" command. Is there a way to "stream" the data through my script as it is written to the file, or would it be better to read the file at regular intervals? If this is the case, how can I read the file without interrupting the program that is writing it? |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Why don't you just write it to a file and to stdout or stderr.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Expert Programmer
|
I'm reading the output produced by what I believe is a commercial program, so I can't change the way it behaves. If that's what you mean...
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Ahhh. I thought you wrote the program. Does it have an option to write to stdout, rather than a file? Then you could pipe it.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Programming Guru
![]() ![]() |
this will probably work for you: http://aspn.activestate.com/ASPN/Coo.../Recipe/414771
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OnlineTextEditor.Com! | Sane | Show Off Your Open Source Projects | 43 | Jun 16th, 2006 9:55 AM |
| add mutiple users to the smbpasswd file. | Pizentios | Bash / Shell Scripting | 3 | Oct 20th, 2005 1:48 PM |
| After execution - Error cannot locate /Skin File? | wchar | Visual Basic | 1 | Mar 5th, 2005 10:04 PM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 5:12 PM |
| Structure char field to a disk file | ehab_aziz2001 | C++ | 0 | Feb 10th, 2005 3:42 PM |