can anyone help me to write pseudo code a kernel fuction called trunc(), which will produce a file of a given number of bytes. expanding or truncating the file as necessary.:confused:
Printable View
can anyone help me to write pseudo code a kernel fuction called trunc(), which will produce a file of a given number of bytes. expanding or truncating the file as necessary.:confused:
I fear not with what you've given us. This function would have to access the file system, that's the non-trivial part of the function. But what filesystem does your OS (I assume it's your own OS) use, how does this system work?
If it's FAT or another established format I'm sure you'll find something on the net.