• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do we take free bytes from the Linux file system ?  RSS feed

 
Amrit Shirodkar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
We are doing File System Simulation in Linux.We want to simulate the "i-node" or "index node" .....We want our inode to be exactly the way it is in Linux ......We will be storing the addresses of the file contents(data blocks) in our inode .....For this, we want the command which will give us the address of free blocks in Linux.In the data blocks we will be having the actual file contents.

Is there some mechanism in Java or some class, which allows us to find addresses of free data blocks ?

Please help.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

If you're writing a "simulation", then write a simulation. Use fixed size records in a RandomAccessFile to represent your disk blocks. But you can't write a real filesystem in Java -- there's no API that will give you that kind of low-level disk access (and of course, you can't really do this kind of messing around in a userspace program, anyway, regardless of language.)
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!