u can only write data to a sector. 010101 bits.
1) u need write to a sectot to record where is u file, the size,... some metadata.
2) then u need write the data of file to certain sector.
about the write,
open /dev/fd0,
lseek,
write.
just like the jjww code. u will get the same answer even u ask several times here.
Can u post u instructor's ORIGINAL requirement here? Let us see if have a solution.