Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "type.h"
- void mychmod(char *pathname, char * param)
- {
- int ino = getino(dev, pathname);
- MINODE* mip = iget(dev, ino);
- INODE* ip = &mip->INODE;
- long int new_mode = strtol(param, NULL, 8);
- ip->i_mode = (ip->i_mode & 0xF000) | new_mode;
- mip->dirty=1;
- iput(mip);
- printf("Mode changed\n");
- }
- /*
- Add Chown if we get to lvl3
- */
- void mytouch(char *pathname)
- {
- int ino = getino(fd, pathname);
- MINODE *mip = iget(fd, ino);
- printf("Target file touched.\n");
- mip->INODE.i_atime = mip->INODE.i_mtime = time(0L);
- mip->dirty = 1;
- iput(mip);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement