![]() |
|
#1
|
|||
|
|||
Double linked List & File Systemi have a code to write in C where i have to implement the mkdir, rm, rmdir and touch functions using double linked lists...im haveing trouble with it...Bellow is the function discription and the code i have so far:
createDir: creates an entryNode for the new directory, copying the argument string into dynamically allocated space for the directory name, then adds the new file to the working directory's entries list. touchFile:creates an entryNode for the new text file, copying the argument string into dynamically allocated space for the file name. It then reads the contents of the simulated text file from standard input, and stores it into suitably allocated dynamic storage. (You should not assume any bound on the amount of text.) Two consecutive carriage returns (that is, '\n' followed immediately by another '\n') indicates the end of this text. The first is stored in the contents string, followed by a null character; the second carriage return is not stored. The new file is then added to the working directory's entries list. removeFile/removeDir: removes the named file/directory from the working directory's entries list, and frees all dynamically allocated storage associated with the file. here is the code i have so far i have so far: HEADER FILE: CPP / C++ / C Code:
CPP / C++ / C Code:
Last edited by admin : 09-Feb-2008 at 08:08.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|||
|
#2
|
|||
|
|||
Re: Double linked List & File SystemQuote:
1. When you post the code, don't put in markups for colors and bold stuff, etc. Put the code between code tags: Put [c] before the first line of C code and put [/c] after the last line of C code. Just type your question(s) and other information into the post with no markups at all 2. Since this is obviously not a "first assignment," the class obviously has some programming language prerequisite(s). You are obviously expected to know how to compile and debug something. Tell us what you tried; don't just post the assignment and some defective code and issue a general request for help. Ask specific questions about what it is that you don't understand. If you tried to compile and the compiler gave errors or other messages that you don't understand, then post the exact message(s). Don't paraphrase; paste the entire message into your post. If there were gobs and gobs of messages, just post the first ten or so. (If the compiler reports an error in, say, line78, then show us what line 78 is. Maybe add a comment in the file , but don't put some uncompileable stuff in the file at that point. Maybe we want to try compiling it before responding to you.) OK, I'll try to unravel some of your post and show you what I mean. Here is what I think your createDir function looks like: CPP / C++ / C Code:
When you compiled the program did your compiler complain about any part of this function? What were the messages? What do you not understand about why this code is defective? Since different compilers have different ways of reporting errors and issuing warnings, it is sometimes useful to those who would like to help you if you tell us what compiler and what operating system you are using for your development. Debugging code is just as much a learning process as writing code. Some would say it's even more of a learning process. Instead of just attempting to "fix" some particular piece of code, we might be able to walk you through parts of the debugging process if we have more information about your environment. Regards, Dave Last edited by davekw7x : 10-Feb-2008 at 09:36.
|
Recent GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 07:44 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| linked list error message | Krandygrl00 | C++ Forum | 4 | 22-Jun-2005 14:13 |
| Double output | leanieleanz | C++ Forum | 1 | 11-Mar-2005 20:19 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The