The most primitive method is perhaps also the simplest and might do the job here: Just write a second file with all bytes except the first 16 ones, delete the first file and then rename the second file.
A more interesting question might be: Why and how do you arrive at a situation where you want to delete the first 16 bytes of a file? Many times that *original* problem has another, better solution that makes deleting something from a file completely unnecessary. Instead of deleting the first 16 bytes, maybe better avoid writing them there in the first place?
Adding and removing stuff from the beginning of a file is very inefficient, and that is generally true for most file systems, not only in Symbian.
If you ever think you need to remove or add things to the start of your file and keeping the rest of the content intact, it means your file structured is badly designed for the task.
If this is an uncommon operation, or the files in questions is very small, it could be ok.
But if the files are big, and you think you need to add or remove from the start of the file often, it means you should re-design your file structure.
Forum posts: 1242
The most primitive method is perhaps also the simplest and might do the job here: Just write a second file with all bytes except the first 16 ones, delete the first file and then rename the second file.
A more interesting question might be: Why and how do you arrive at a situation where you want to delete the first 16 bytes of a file? Many times that *original* problem has another, better solution that makes deleting something from a file completely unnecessary. Instead of deleting the first 16 bytes, maybe better avoid writing them there in the first place?
Compare also this earlier thread about inserting some new content into a file:
http://www.newlc.com/topic-14592
René Brunner
Forum posts: 49
You can also open file in read/write mode and rewrite it ( move data that it will start at the begining of the file ) and truncat it at end
Forum posts: 1232
Adding and removing stuff from the beginning of a file is very inefficient, and that is generally true for most file systems, not only in Symbian.
If you ever think you need to remove or add things to the start of your file and keeping the rest of the content intact, it means your file structured is badly designed for the task.
If this is an uncommon operation, or the files in questions is very small, it could be ok.
But if the files are big, and you think you need to add or remove from the start of the file often, it means you should re-design your file structure.