fat information

Programming, for all ages and all languages.
Post Reply
aditigupta
Posts: 5
Joined: Wed Jul 11, 2007 11:15 pm

fat information

Post 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
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post 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...
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Post 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..
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post 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.
aditigupta
Posts: 5
Joined: Wed Jul 11, 2007 11:15 pm

Post 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.....
User avatar
dc0d32
Member
Member
Posts: 69
Joined: Thu Jun 09, 2005 11:00 pm
Location: Right here

Post 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.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post 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.
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Post 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.
User avatar
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Post 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.
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
Post Reply