// for mixer, emptys file int clobber(FileSys& filesystem, string file) { // int Firstblock(String s), 0 if no blocks, -1 if s doesnt exist, else first block of s // int Nextblock(String s, int i) 0 if i is last block of s, -1 if i doesnt belong to s, else next block after i in s // void? Delblock(String s, int i) removes i from s int firstBlock = Firstblock(file); int returnValue = 1; if(firstBlock != 0) // if the file isnt empty already { int blockNumber = firstBlock; bool moreBlocks = true; while(moreBlocks) { int nextBlock = Nextblock(file, blockNumber); if(Delblock(file, blockNumber) == 0) { // ERROR moreBlocks = false; returnValue = 0; } if(nextBlock == 0 || nextBlock == -1) { moreBlocks = false; } else { blockNumber = nextBlock; } } } return returnValue; // not mentioned }