int write_inode(char *filename int index, char *name, int offset, int length) {
    Inode inode;
    FILE *fs = fopen(filenname, "r+");
    strncpy(inode.name, name, MAXNAME);
    inode.offset = offset;
    inode.length = length;
    if (fseek(fs, index * sizeof(Inode), SEEK_SET) == -1) {
        perror("fseek");
        return -1;
    };
    fwrite(&inode, sizeof(Inode), 1, fs);
    return 0;
}