Mark Gritter (markgritter) wrote,
Mark Gritter
markgritter

Unix geekery

I fixed a bug this week which involved a subtle distinction in the behavior of

int f = open( filename, O_RDONLY );
fchmod( f, permissions );


and

chmod( filename, permission );

Can you guess what situations the latter handles that the open()/fchmod() combination does not?

A Unix domain socket appears in the file system (under Linux, at least) and you can perform a chmod() it, but you can't open() it.
Tags: geek, programming, unix
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments