- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- File got corrupted. Zeros are removed !
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 09:02 AM
тАО09-08-2005 09:02 AM
File got corrupted. Zeros are removed !
I would like to have some hints on this problem.I had a binary file in which all the zeros (0) are missing(!).We never saw a corruption like that.
Comparing the Good file againt the corrupted one we discovered that the two files are equivalent except for the fact that within the Bad file
all the zeros (0) are missing.
Our correct file had record has a fixed size of 512 bytes. Since the
record space is not completely used, there is some field that is set to
0 (zero).
The corruption of this file is evident but we cannot figure out who or what on HP11i can cause it (I dont' consider the fact that intentionally caused it) We simulate this opening the binary file with the vi and then save it with wq!. On this machine there is Openview and also Data protector HP. 11.11i.
The corruption is evident also because the orginal (good file) was of like 2mb.
When the corruption occurred it was 500k.
The zeros are not more there.
We had different records of 512 bytes each and part of this 512 were written with significant data.
Our Application write/read on this file each time 512 bytes (not less!) but our file always grows (in this case it decrease of size) because we wrote on them;
Some other part of 512 are not used and they are filled with zeros.
In the whole file, in each 512 records, the zeros are not more there!
The file was significant smaller that the original one and the zeros are not more there. We also verify this situation using HexComp a plug-in of Beyondcompare.
We don't do any action that can cause that the file will be more smaller of the original one.
What I saw using HexCoomp
is that on each of 512 records of this file the zeros are not more there.
We don't do that from code point of view.
Thx.
- Tags:
- NULL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 09:07 AM
тАО09-08-2005 09:07 AM
Re: File got corrupted. Zeros are removed !
This is your third post of the same problem. You had considerable, very good feedback, in my opinion in at least one other thread.
It is to everyone's benefit to continue the dialog in one thread rather than post and repost.
PLEASE SEE:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=954374
and:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=954511
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 09:08 AM
тАО09-08-2005 09:08 AM
Re: File got corrupted. Zeros are removed !
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 09:12 AM
тАО09-08-2005 09:12 AM
Re: File got corrupted. Zeros are removed !
Thanks anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 09:22 AM
тАО09-08-2005 09:22 AM
Re: File got corrupted. Zeros are removed !
1) An application error, which you don't believe.
2) Human error. Someone did some command against that file and messed it up. There are a number of commands that could cause corruption of a binary file. If you have shell history enabled for users, go through them and see if the filename of your data file shows up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 11:15 AM
тАО09-08-2005 11:15 AM
Re: File got corrupted. Zeros are removed !
Maybe the OS knows your pathname. Why not rename the file? Somehow, I'll bet that mean OS still decides to trash just your file. I am sometimes amazed at how my own perfect, error-free code manages to have a bug every now and then.
Is the data that used to be zero's garbage now? If so that might be unitialized data.
It would really help if you you at least explain if you are using low-level io (read,write,lseek) or hi-level i/o (fread,fwrite,fseek) or even text-based i/o (fprintf).
Does you application code indicate any sort of error when this happens?
Is your code multi-threaded? If so, are you using thread-safe mechanism's? Those are the kinds of issues that can prove very difficult to ytrackdown and even seem to be OS related but are more accurately the misuse of functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2005 09:35 PM
тАО09-09-2005 09:35 PM
Re: File got corrupted. Zeros are removed !
rm xxx
for arg in 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
do
echo "\0" |tr -d"\n" >> xxx
done
The above script created a file with 17 binary "zeros" otherwise known as nulls (od xxx or any hex viewer will ussually show them a zeros)
I then used vi to open the file.
Sure enough a wq! emptied the file.
You are either checking with or using a text oriented application to view or modified a binary file. Text applictions written in c uses arrays to minuplate strings. The simple answer is that a "null" within this type of applications is a end of string, thus truncating all of your zeros or "nulls". You have to make sure that you use applications that are binary aware when manipulating your particular data.
Your applications have to be aware of string lengths, Apps that process binary files need to read and write and update data using fixed blocks, or at least well defined block length based on files size.