Thread: FAT creation
View Single Post
Old Dec 7th, 2005, 6:19 AM   #18
BungalowBill
Programmer
 
Join Date: Dec 2005
Posts: 40
Rep Power: 0 BungalowBill is on a distinguished road
I've got a piece of code for myfopen.

Myfile * myfopen(){
Myfile * file = (Myfile*) malloc(sizeof (Myfile));
memmove(file->buffer.data, disk[79].data, blocksize);
file->pos = 0;
return file;

that gets whatever is in diskblock 79. How would i change that to make it get the data from any postion the user selects? i.e.

Myfile * myfopen(const *char path, const char * mode){
Myfile * file = (Myfile*) malloc(sizeof (Myfile));
memmove(file->buffer.data, (path,mode) blocksize);
file->pos = 0;
return file;

but that doesn't work. Does anyone know the answer to this? i need something instead of the bit in bold. Cheers for any help.
BungalowBill is offline   Reply With Quote