LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-12-2009, 12:10 PM   #1
kian
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Rep: Reputation: 0
Unhappy How can I write a virtual disk with c language in ubuntu?


Hi
I want to write a program with c language that:
writting a file system for a virtual disk that this disk has 128 blocks each 1 KB.
this file system supports 16 files/diretory that each file/directory has 8 blocks.the name of file is consist of at most 8 charachter.
I want from my friend help me to do this program.thank you
 
Old 04-12-2009, 12:17 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
we can't help you to write an entire program, that's very unrealistic. Also becuase this is such an odd question, I'm inclined to think that this is homework, something which you should not be asking on our forums.
 
Old 04-13-2009, 12:42 AM   #3
kian
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Unhappy

Hi
I don,t want you to write entire program for me.just if you can tel me how can I start this program.I mean how can I create a file system in ubuntu with c language.
thank you
 
Old 04-13-2009, 01:23 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
how to create a filesystem is not a "start" in any way. that's a lot of stuff to know.
 
Old 04-13-2009, 06:22 AM   #5
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
I want from my friend help me to do this program.
That'll not be me then...

This question does sound like homework, so you'll get the kind of answer that you'd get if it was a homework question. You may well think that unfair.

You do not ask about anything practical. I can see no way you would use this system for anything as it is too trivial/underspecified for most practical purposes.

Quote:
writting a file system for a virtual disk that this disk has 128 blocks each 1 KB.
this file system supports 16 files/diretory that each file/directory has 8 blocks.the name of file is consist of at most 8 charachter.
There are many ways of starting; I would start by trying to map out the blocks. In some way, you will have to be able to think about a mapping between blocks and data structures. You would then have to work out what you would have to do to which block in order for certain operations to take place.

You mention the files having names; in some way, there must be a mapping between file names and the blocks in use on the disk. You mention 'characters'; think about what that means. ASCII characters? Unicode characters? Does this make a difference?

There will be a data structure for the filenames, and you will have to think about the operations that can occur on that data structure.

You mention writing; that's nice, but without the ability to read, it is unclear that this system can have any purpose, apart from for training (and if you don't go on to work out how to read, it might not even be particularly good for training, but I do not know where you are in your studies...but maybe your instructor has that planned as your next exercise).

The interested reader may have already though about write-only memory.

Once you have worked out how the data structures work, you can think about what is necesssary to write a new file; you would have to have a utility to which you can supply a filename and it would react by writing the header to disk and may reserve some space.

In the case of files which will use multiple blocks of data, how will that work? It looks as if you could assume that every file was of the same length, irrespective of the amount of actual data in it, although this would be horribly inefficient in real life.

If that is true, at least you don't have to deal with the problem of extending the file.

There is a case, and I'll not put it stronger than that, that you should regard these various operations on the file as 'use cases' and you should look at all of the applicable use cases.

It is also unclear to me why you should be unaware of any of the above, if your instructor has prepared you for this little problem adequately. You may want to comment on that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Parrot 1.0 Said to Speak Your Virtual Language LXer Syndicated Linux News 0 03-20-2009 12:20 AM
best language to write a new site in M.Brice Programming 17 10-26-2006 02:10 AM
How I able to write in different language other than english raatbaki_4u Linux - General 2 08-28-2006 03:08 AM
make my mandriva 10,2 write japanese as second language maurolinux Linux - Newbie 2 03-21-2006 10:24 AM
FEDORA 2: Change language in Openoffice WRITE stergios Linux - Newbie 0 06-01-2004 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 07:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration