예제 #1
0
파일: efs.c 프로젝트: samkrew/nxp-lpc
/**
 * This function will set a hook function, which will be invoked when a memory 
 * block is allocated from heap memory.
 * 
 * @param hook the hook function
 */
int efs_unlink(struct dfs_filesystem* fs, const char* path)
{
	efsl_fs* efsfs;

	RT_ASSERT(fs   != RT_NULL);
	efsfs = (efsl_fs *)fs->data;

	RT_ASSERT(path  != RT_NULL);
	RT_ASSERT(efsfs != RT_NULL);
	
	return un_link(&efsfs->filesystem, (euint8 *)path);
}
예제 #2
0
void File::remove() {
    // Remove this file.
    char line[LINE_LENGTH];
    fprintf(stderr, "Removing %s\n", path);
    if (save) {
        sprintf(line, "mv %s %s.OLD", path, path);
        if (execute(line))
            exit(-1);
    } else {
        if (do_echo) {
            printf("rm %s\n", path);
        } else {
            if (un_link()) exit(-1);
        }
    }
}