![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| On Premature Optimization | iBot | Complex Event Processing RSS News | 0 | 02-12-2008 02:20 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Premature EOF
How to check for a premature EOF in a regular file in a shell/perl script?
I want to check if I have received a complete file or not. Thanks, Rahul. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Why not use checksum ?
|
|
#3
|
|||
|
|||
|
here is one more,
have a trailer record for each of the file you are receiving (just including a single line is not going to affect the receiving file size) trailer record to contain no of records in the file existence of trailer indicates complete file transfer |
|
#4
|
|||
|
|||
|
But How?
Vino,
How to use checksum? When i type checksum on my command prompt, it says command not found. I am using a Sun Solaris 5.8 Madhan, I am using wget to grab the webpage running on Windows server. What the following command does is create a file with the webpage URL name in my current directory. wget -nv -o /tmp/wget.csv.log -t 5 -w 10 http://vpcmsa06/qos/1HRScsv.asp Now, Without doing any modification to this file i.e http://vpcmsa06/qos/1HRScsv.asp, I want to check if it has a premature EOF. Any advise would be helpful. Thanks, Rahul. |
|
#5
|
|||
|
|||
|
i understand that the modification to the existing asp file would not be possible
instead, is it possible to idenitfy the start and end of the file with markers just as we do in html pages ? (ex only) <HTML> </HTML> but i am not sure how far this could be made use of .... its just an example or kind of way proceeding with that. |
|
#6
|
|||
|
|||
|
No Specific Markers
These files will not have any specific start or end markers and hence I am unable to do a premature EOF check.
Thanks, Rahul. |
|
#7
|
||||
|
||||
|
I will still stick to Vino. If you have a way to get the checksums of the file from the place where you are getting it, then you can run the command cksum on the received file, and then match the two. cksum is one of the surest way to convince that the file received is complete and exactly the same as one that is sent.
__________________
War doesnt determine who is right, it determines who is left |
||||
| Google The UNIX and Linux Forums |