How can I gain information of file Content ?
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anshuman_Mehta
Posted On:   Monday, August 1, 2005 06:42 AM


I simply put was creating code to split large files and then merge them back to the original.
The approach i had taken up was to read 'n' bytes from some N'n' large file to split it into N parts. But somehow after remerging the files they become corrupt for .dat, .mp3 , .zip extensions etc.


I have checked the bit versions for the original and the merged file and they are exactly the same . So why is the file corrupt ?



Is there a way for making a particular file become a .dat file or a .mp3 file ?

Re: How can I gain information of file Content ?

Posted By:   Anshuman_Mehta  
Posted On:   Friday, August 5, 2005 02:16 PM

I have solved the problem although i am still not sure.
I had initially tried to read in byte arrays ; but when i tried read in a byte at a time it worked.
Prolly something to do with the last byte array of some 'n' part becoming corrupt for its dependency on the next byte in 'n+1' part ? ..

Re: How can I gain information of file Content ?

Posted By:   Jani_Kaarela  
Posted On:   Tuesday, August 2, 2005 03:12 AM

Were you using byte streams or character streams?

Re: How can I gain information of file Content ?

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, August 1, 2005 07:50 PM

I have checked the bit versions for the original and the merged file and they are exactly the same . So why is the file corrupt ?


They must NOT be exactly the same, or else you could rename one to the other and they would behave exactly the same.


Binary files like that will have bytes that you can't see with most ordinary editors, including null bytes, and these might have been disturbed, in your new copies?

Re: How can I gain information of file Content ?

Posted By:   Almagest_FUTT  
Posted On:   Monday, August 1, 2005 08:51 AM

Files are bunches of bytes. OSses may perform some special operations based on the file name's extension, but then again may not.

I'd suppose you have some error in your read/merge/check mechanism, may you forget to flush, or maybe even some encoding stuff, for it basically should work.
About | Sitemap | Contact