file compactation
I need to remove user specified bytes ( could be in between) from file and then compact the file.All I got is brute-force method. Say user says to remove bytes 5-10 from file of size 100 bytes, then I'am shifting 90 bytes of data( bytes 11 to 100) back to 5 bytes.
Any other optimal approach or system call which could make this efficient? |
Code:
dd if=/tmp/test bs=1 skip=5 count=5 |
Admiral Beotch,
I think you didnt get me. Say a file contain data as "Linuxquestions.org" total of 17 bytes, now if user want to remove bytes 6-14 then content of file should be "Linux.org".I am asking for efficient method to do this.And yes preferably through C program. |
I got what you meant. This is what I was talking about:
'skip.sh 5 14' Code:
skipBegin=$1 |
All times are GMT -5. The time now is 09:53 PM. |