Sponsored Content
Full Discussion: detecting corrupted file
Top Forums Shell Programming and Scripting detecting corrupted file Post 40889 by google on Wednesday 24th of September 2003 05:52:15 PM
Old 09-24-2003
Hmm, what would you define as a corrupted file? How would you know if something is corrupt? Since everything in Unix is just a file, I dont think you can say that one file is corrupt vs another file without evaluating its attributes. If its a binary, then running it would tell you that its corrupt when it fails. Capture the return code after its execution. Anything non-zero would imply an issue.
Can you clarify what you mean?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

corrupted tar file

Hi all, I've got a corrupted tar file with some filename being like ?a=n is it possible to get them repaired? (1 Reply)
Discussion started by: klintsovi
1 Replies

2. HP-UX

passwd file corrupted

Good Day Our HP box was hacked and the passwd file has been altered,there are only 2 user accounts active,and these dont have any administrative rights.I need to edit the passwd file to correct the su and root entries. Does any body have any suggestions as to how i can do this with out the root... (10 Replies)
Discussion started by: cantona7
10 Replies

3. UNIX for Dummies Questions & Answers

Help! passwd file corrupted

Hi, I am new to UNIX, and have recently installed Suse 9.3. I have been experimenting with all of the commands and have somehow managed to modify the default shell of the root user to an invalid file. Consequently I cannot su to the root user as I receive the 'no such file or directory' error... (2 Replies)
Discussion started by: Tony Montana
2 Replies

4. HP-UX

Could be a corrupted file?

Hello! Do you know the meaning of... "crw-rw---- 1 informix informix 64 0x020001 Jan 21 2004 rifxroot" I don't know what the first "c" means. Furthermor, if I try to copy this file (rifxroot) it appears a message: "cp: cannot open rifxroot: No such device or address" I don't... (1 Reply)
Discussion started by: kaugrs
1 Replies

5. UNIX for Dummies Questions & Answers

may a corrupted .gz file be repaired?

Preparing for a move to a new server, I needed to offload about somewhat over a gigabyte of newsfeeds that my website collects, and that I had been saving on the server. I tarred them and zipped them into about a dozen smaller files of about 150Mb each. All seemed well. I downloaded them onto my... (3 Replies)
Discussion started by: JohnTinker
3 Replies

6. Solaris

root mail file corrupted

Hi, We were facing cron job failures and raised a case to our UNIX team, they fixed the issue and said cron job failures due to root mail file corruption. My questions are, 1. Whether root mail file corruption cause cron job failures? 2. Do we have any size limitation for root mail file?... (0 Replies)
Discussion started by: paventhan
0 Replies

7. Solaris

WTMPX File corrupted

Hi All I work on solaris 8, 9 and 10 platforms and have encountered an error which is my wtmpx files appear to be corrupted as all entries contain the date 1970 (the birth of unix). Now this is obviously not the case, so my query is: 1 - Can the existing wtmpx files be manipulated to... (6 Replies)
Discussion started by: drestarr96
6 Replies

8. Linux

Corrupted daemon.log file

hi, yesterday I made something wrong and deleted daemon.log file. Then created a new file with the same name under the same path but now, it seems that file constructed has been corrupted . In earlier times, it was including regex name. Now there is no regex name. This is the current... (0 Replies)
Discussion started by: baris35
0 Replies

9. Red Hat

.bash_profile file corrupted

Hi, Unexpectedly i entered wrong entries in .bash_profile for my user which has administrative permissions. So, i am getting errors for every command. I dont have backup file also, so any body can help me how to recover it. Regards, Mastan (7 Replies)
Discussion started by: mastansaheb
7 Replies

10. UNIX for Dummies Questions & Answers

After Ftp'ing file to destination how to check the file if it is in correct ASCII and not corrupted

Hi Folks, While transferring file from FTP software like Filezilla the files gets corrupted. Is there any way I can check if the recently transferred file is in ASCII and not corrupted. I have tried using file -i filename command which does tell if the file character set is ASCII or binary... (6 Replies)
Discussion started by: Khan28
6 Replies
srec_msbin(5)							File Formats Manual						     srec_msbin(5)

NAME
srec_msbin - Windows CE Binary Image Data Format DESCRIPTION
This format is the output of the Microsoft WinCE Platform Builder. This is a binary (non-text) file format. File names in this format typically (ambiguously) use the .bin suffix. File Format Files in this format start with a header record. Then comes the data itself, organized into records. The file finishes with an execution start address record. This is mandatory. File Header Record Data in this format start with an optional header containing the magic "B000FF ", followed by the image start (four bytes, little endian) address and the span of the image (highest address - lowest address + 1) (four bytes, little endian). The file header does not have a checksum; it is therefore possible that a corrupt file header will go undetected. +-----------+------------+------------+ |Magic | Least | Greatest | |"B000FF " | Address | Address | |(7 bytes) | (4 bytes) | (4 bytes) | There-is-no-provision-for+a-file-comment of any kind. Data Record Each record consists of a record start address (four bytes, little endian), a record length (four bytes, little endian), a record checksum (four bytes, little endian), followed by the record data. The data part of each record is raw byte values, no encoding. +----------+-----------+-----------+-----------+ |Start | Length | Checksum | Data | |address | (4 bytes) | (4 bytes) | | |(4 bytes) | | | | +----------+-----------+-----------+-----------+ The checksum is calculated by a simple sum of unsigned bytes into a 32-bit accumulator. The 12 record header bytes are not included in the record checksums; it is therefore possible that a corrupt record header will go unde- tected. It is not possible to place data at address zero with this format. Address zero is reserved for use by the execution start address record. There is effectively no limit on the length of a record (2^32-1). It is not uncommon for a MsBin file to contain records with sizes in the tens of megabytes. Execution Start Address Record Last comes a special record with the record address set to zero and record length set to the image execution start address. According to specification the record describing the execution start address must be always present, and must always be the last record in the file. +----------+-----------+-----------+ |Zero | Start | Checksum | |(4 bytes) | Address | = 0 | | | (4 bytes) | (4 bytes) | +----------+-----------+-----------+ Commentary The MsBin files produced by SRecord are valid and can be successfully parsed by the command line utilities viewbin and cvrtbin (part of Windows CE platform). For a MsBin file to be usable in Microsoft WinCE Platform Builder it has to contain a TOC meta-structure. This is data embedded in the file by Microsoft WinCE Platform Builder itself. The opposite conversion - from MsBin - comes in handy when analyzing a MsBin file (i.e. a WinCE image). Size Multiplier In general, binary data will expand in sized by approximately 1.0 times (approaching asymptotically from above) when represented with this format, as the 15-byte file header is averaged over the data content. Holes in the data will also increase the size. SOURCE
http://msdn.microsoft.com/en-us/library/ms924510.aspx COPYRIGHT
srec_cat version 1.58 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Peter Miller The srec_cat program comes with ABSOLUTELY NO WARRANTY; for details use the 'srec_cat -VERSion License' command. This is free software and you are welcome to redistribute it under certain conditions; for details use the 'srec_cat -VERSion License' command. AUTHOR
Peter Miller E-Mail: pmiller@opensource.org.au //* WWW: http://miller.emu.id.au/pmiller/ Reference Manual SRecord srec_msbin(5)
All times are GMT -4. The time now is 02:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy