Jump to content
  • Advertisement
Sign in to follow this  
Gink

Question about sectors

This topic is 4850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What is the significance of storing files on 512 byte sectors? And what happens with unused data within the sector? Also, is it possible to notice that every file you create will cause 512 bytes from a sector to be allocated for file storage?

Share this post


Link to post
Share on other sites
Advertisement
Yes. Files are stored in whole numbers of sectors (actually, whole number of clusters, which will be some power of two number of sectors). The extra space is wasted.

Share this post


Link to post
Share on other sites
So, lets suppose i have a 2000 byte hard drive

If i save 5 1 bytes files I wont have any storage space left?

Share this post


Link to post
Share on other sites
How would you know you are running out of space? If I save a 1 byte file it doesnt say that I lost 512 bytes of space.

Share this post


Link to post
Share on other sites
For each file, the OS keeps track of two numbers -- the size of the file, and the amount of space it takes up on the disk.

Share this post


Link to post
Share on other sites
Do you have a 2KB hard drive? I don't even have a diskette that is smaller than 360Kb (5.25" floppy, low density).

Share this post


Link to post
Share on other sites
Quote:
Original post by nprz
Do you have a 2KB hard drive? I don't even have a diskette that is smaller than 360Kb (5.25" floppy, low density).


Quote:
So, lets suppose i have a 2000 byte hard drive


Learn to read

my files say they take up 4096 bytes each

Share this post


Link to post
Share on other sites
Then 4096 bytes is your cluster size (8 sectors). I should note that a sector is the basic unit of disk access. Your hard drive can only read and write sectors, it can't read/write individual bytes. Clusters are an operating system/file system invention.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!