Menu

#3 Deleting or renaming files invalidates client file handles

open
5
2008-03-19
2008-03-19
Josh Taylor
No

// Rename crash (assume "/foo" is a valid
// file and "/bar" doesn't exist)
int fd = client->Open("/foo", O_RDONLY);
client->Rename("/foo", "/bar");
char buf[256];
client->Read(fd, buf, sizeof(buf)); // crash

// Delete crash (assume "/foo" is a valid file)
int fd = client->Open("/foo", O_RDONLY);
client->Remove("/foo");
char buf[256];
client->Read(fd, buf, sizeof(buf)); // crash

Discussion

  • Josh Taylor

    Josh Taylor - 2008-03-19
    • summary: Deleting or renaming files invalidates client file handles ( --> Deleting or renaming files invalidates client file handles
     
  • sriramsrao

    sriramsrao - 2008-03-19
    • assigned_to: nobody --> sriramsrao
     

Log in to post a comment.

Monday.com Logo