The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
sys-filesystem, inodes, windows

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Daniel Berger

Posts: 1383
Nickname: djberg96
Registered: Sep, 2004

Daniel Berger is a Ruby Programmer who also dabbles in C and Perl
sys-filesystem, inodes, windows Posted: Nov 6, 2006 7:14 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Daniel Berger.
Original Post: sys-filesystem, inodes, windows
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Daniel Berger
Latest Posts From Testing 1,2,3...

Advertisement
A while back a guy by the name of Mike Hall had a package out there called "filesystem" that was a pretty basic wrapper for statvfs and getmntent(). Unfortunately, Mike is now AWOL and so is the package.

So, I've been working on sys-filesystem, which will do what Mike's old package did and more. I'm spending more time working out a common interface for UNIX and Windows than anything else, which is more difficult than you might think.

One bit of incompatibility for a statvfs is that the Windows filesystem doesn't have the concept of an inode. I thought I could work around this and get a good approximation of the f_files struct member. My plan was to create a tiny partition, create as many small files as I could until Windows told me there was a problem, and calculate the number of files by dividing the total space of the partition by the number of files that were created.

Except, it doesn't work.

The first problem is that Windows reserves a fraction of the partition for, well, I don't know what. In my 8192512 byte partition, Windows reserved 13824 bytes for itself. That left 8178688 bytes. With a block size of 512 I should theoretically be able to create 15974 files. In reality I was only able to create 4174.

Lessee...8178688 divided by 4174 is...1959.43. So, either Windows is lying to me about the block size or my brilliant plan just doesn't work. I'm guessing the latter.

And this, boys and girls, is where I simply nod my head when the many, many experts I found online say you cannot reliably determine how many files a Windows partition can hold.

Read: sys-filesystem, inodes, windows

Topic: The Power of Tests Previous Topic   Next Topic Topic: Ruby Weekly News

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use