ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In case of UNIX file system, how many pointers from I Node block are needed to access memory size of 1,00,000 bytes of data? (Assume 1 pointer= 4 bytes, 1 block = 512 bytes)
Can anyone provide me the solution to above problem??
Smells like homework to me. I could be wrong, but you could tell us which way it is - and in case it's homework, read the rules of posting again, to find out what they say about homeworks and helping in them.
If it is a homework, maybe you should re-read the material in which you are introduced to this thing. Nobody, say an ape, can tell the answer if we assume that not everybody knows what "UNIX filesystem" means, so I'll assume you either have material, or have been shown how these things are calculated.
If I'm wrong and this is not a homework, just happens to sound like one, please correct me. In any case, how would you think it was? What is your lucky guess? Why?
Smells like homework to me. I could be wrong, but you could tell us which way it is - and in case it's homework, read the rules of posting again, to find out what they say about homeworks and helping in them.
If it is a homework, maybe you should re-read the material in which you are introduced to this thing. Nobody, say an ape, can tell the answer if we assume that not everybody knows what "UNIX filesystem" means, so I'll assume you either have material, or have been shown how these things are calculated.
If I'm wrong and this is not a homework, just happens to sound like one, please correct me. In any case, how would you think it was? What is your lucky guess? Why?
Hi there.
This is not at all a home work. I m trying to learn Linux programming on my own. I m also surfing net for this purpose and i got this question somewhere on net. So plz give me some reply.
Is it just me, or is it just a simple math problem disguised as a programming one? Am I ignorant in thinking that it might be solved by merely "arithmetizing" the provided numbers? That would be a lot easier if I knew whether it was 10,000, 100,000, or 1,000,000. Maybe I am just plain wrong.
ta0kira
You might well be right Ta0kira. I thought it myself when I first read the question, but I was thinking of the "Emperors New Clothes" at the time so held my tongue. The answer to the question should maintain the same degree of precision of the original so the answer has to be 196 pointers to 512 byte blocks = 99841 to 100352 bytes. Plus 1 for the initial inode perhaps which makes 197?
Of course this might be expressed as 19,7 as mentioned earlier to retain precision(?) Not to conrfuse anyone on the continent of europe who might use "," as a decimal point.
Was this a sizing exercise to determine how many inodes would be required to address x thousand bytes of storage, given that the inodes themselves would consume part of the storage. A size of of 1,000,000 is exceedingly small (very old book - first commercial Winchester technology disk was 1Mbyte, more than a few years ago). Personally I would be more than slightly inclined to move on to the next question, having got the idea of the structure of things http://upload.wikimedia.org/wikipedi...Ext2-inode.gif
I think that there is a little more than simply the "article" missing from question, which renders it more than a little open ended. Alokatzenith you might be mistaken for a business analyst moving to programming. The precision of the original question was akin to some of the part specs I've seen in my time. Just joking, nothing personal.
I m highly grateful to all who have spend their valuable time on this problem and replied me. But i m very sorry to say that none of the answer is correct. The problem which i have posted has 4 option associated with it viz
a)10 b)11 c)13 d)14
As i said in my earlier post that i m trying to learn Linux prog. on my own so i have posted the problem without options, thinking that it is an easy problem.
Don't you just love it when people play games with cards hidden up their sleeves?
Dr House has a distinct view about the honesty or otherwise of his patients!
I can't see how any of the four answers can be right. I don't suppose that there are four plausible explanations as to how the answer can be proved?
As i said earlier i m a student and trying to learn Linux prog. on my own So i also dont know the question. I was expecting answer from this forum but i m very sad now.
But plz try to find out the answer and plz plz reply me if anyone get the answer.
How can it be that you know the answer, but not the question. What you wrote is not clear to anyone because there is no such number as '1,00,000'.
And, when you say Unix file system do you mean to refer to UFS?
I m highly grateful to all who have spend their valuable time on this problem and replied me. But i m very sorry to say that none of the answer is correct. The problem which i have posted has 4 option associated with it viz
a)10 b)11 c)13 d)14
As i said in my earlier post that i m trying to learn Linux prog. on my own so i have posted the problem without options, thinking that it is an easy problem.
You are correct, it is easy to provide an answer for your question. I have no difficulty in absolutely identifying answer d). 14 as the best answer. Of the candidate answers, this is the one most likely to safely satisfy the requirement. In practical terms, given this question and having to allocate a number of pointers to reliably satisfy the requirement.
My logic is that the penalty for getting the answer wrong and not being able to properly address the memory correctly is abject failure and would result in the project failing. Knowing this, I am convinced that you all would select answer d as the safest and most likely candidate, given that the answer must be taken from one of the supplied answers. More project psychology than technical detail at the end of the day. Fail safe, memory is cheap and time is money.
Ta0kira, I see you stroking your chin, such wisdom!
I'm sorry that it has taken us so long to arrive at this result. I trust that you are happy again now. Good luck with your other studies.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.