Page 1 of 1

fat information

Posted: Mon Jul 16, 2007 1:08 pm
by aditigupta
hi

as i m doin data recovery project for floppy disk whenever i put some big doc file of abt 600 kb or so then i get negative sector number in my fat information and hence that sector is not read..........

m doin all this in c/c++

wat can be the reason for negative value of sectors

plz help

thanks

Posted: Mon Jul 16, 2007 2:25 pm
by AJ
I know nothing about reading from disks directly, but it sounds to me suspiciously like you are using signed integers when you should be using unsigned integers...

Posted: Tue Jul 17, 2007 12:55 am
by hailstorm
Probably a stupid question; but did you realize that on floppy disks, fat-12 is used? I'll bet you forget to shift the clusternumber by four or anding by 0xfff
Otherwise you get very strange clusternumbers... It just not possible that your 12 bit number is negative, since the 16th bit of an (16 bits) integer is the sign..

Posted: Tue Jul 17, 2007 1:32 am
by pcmattman
Show us your code :D

Edit: there is a good reason for this, we can help you better if we can see your code and what you're trying to do.

Posted: Fri Jul 20, 2007 7:48 am
by aditigupta
probably u think that the other person is a fool........ its not a stupid question....... i hav been working on this since two months n u cant just cant expect me to do such a foolish mistake i do know the reading logic.....

thanks neways

i thru with my project.....

Posted: Fri Jul 20, 2007 1:06 pm
by dc0d32
[probably] Miss. Gupta, I do not think you will visit this forum again, but just in case you do......
aditigupta wrote:probably u think that the other person is a fool........ its not a stupid question.......
hailstorm wrote:Probably a stupid question; but did you realize that on floppy disks, fat-12 is used?
did you know - Learning English really helps. It's not your question that hailstorm is referring to, but his/her own.
aditigupta wrote: thanks neways
You are always welcome.

Posted: Fri Jul 20, 2007 1:56 pm
by Candy
aditigupta wrote:probably u think that the other person is a fool........ its not a stupid question....... i hav been working on this since two months n u cant just cant expect me to do such a foolish mistake i do know the reading logic.....

thanks neways

i thru with my project.....
Do you mask out the top 4 bits? If not, as soon as you get beyond sector 2048 you'll get negative numbers. That's about a megabyte though, so it might be something else.

Posted: Fri Jul 20, 2007 2:59 pm
by hailstorm
prashant wrote:[probably] Miss. Gupta, I do not think you will visit this forum again, but just in case you do......
aditigupta wrote:probably u think that the other person is a fool........ its not a stupid question.......
hailstorm wrote:Probably a stupid question; but did you realize that on floppy disks, fat-12 is used?
did you know - Learning English really helps. It's not your question that hailstorm is referring to, but his/her own.
aditigupta wrote: thanks neways
You are always welcome.
Exactly, I was referring to my own question; I know from experience that small bugs in code can be a pain in the @$$. Secondly, I would never call somebody stupid on any forum whatsoever.

Posted: Sat Jul 21, 2007 5:26 pm
by B.E
aditigupta wrote:probably u think that the other person is a fool........ its not a stupid question....... i hav been working on this since two months n u cant just cant expect me to do such a foolish mistake i do know the reading logic.....

thanks neways

i thru with my project.....
We can only comment on what we are given.