0

I want to modify do_mkdir in /usr/src/servers/vfs/open.c in order to when i try to use mkdir command to print in terminal the absolute path to the directory i created.How can i achive that ? Any ideas?

I tried the getcwd but i got a undefined reference error .

user1809300
  • 703
  • 4
  • 9
  • 17

2 Answers2

0

The full path is in the variable fullpath defined in the beginning of the do_mkdir function. Also the access rights are on the variables listed in the code below

printf("New dir -> %s, ", fullpath);
printf( (bits & S_IRUSR) ? "r" : "-");
printf( (bits & S_IWUSR) ? "w" : "-");
printf( (bits & S_IXUSR) ? "x" : "-");
printf( (bits & S_IRGRP) ? "r" : "-");
printf( (bits & S_IWGRP) ? "w" : "-");
printf( (bits & S_IXGRP) ? "x" : "-");
printf( (bits & S_IROTH) ? "r" : "-");
printf( (bits & S_IWOTH) ? "w" : "-");
printf( (bits & S_IXOTH) ? "x\n" : "-\n");

Put this code in the end of the do_mkdir just before the unlock_vnode(vp); line and you are done!

Έχεις κάνει τα υπόλοιπα ερωτήματα??

Konrad Krakowiak
  • 12,285
  • 11
  • 58
  • 45
0

I believe that simply printing the fullpath variable doesn't work. Actually, I tested this out and it seems to print only the name of the directory created. Any clues?

user3761291
  • 73
  • 1
  • 7