3
votes
4answers
143 views

Improving file reading

I am programing in C language and have created the below functions to read files. There are two functions that I can use to read files. I wanted to know how I can further improve these two in terms of ...
1
vote
1answer
70 views

Trimming whitespace from the beginning and ending of a file

In the code below, I want to remove the "white space character" from 2 places only, from the end of 1st line and from the end of last line. How can I optimize it ? Platform : Linux , gcc compiler ...
2
votes
2answers
82 views

How to improve the way I handle greping in this script

What my script does is: Append data to a file on a continuous basis. If an error pattern is observed, then do something. I need feedback on the way I am grepping for patterns in the continuously ...