Contribute  :  Calendar  :  Advanced Search  :  Site Statistics  :  Directory  :  Files to download  :  Links for developers  :  Privacy policy  :  Web Resources  :  Polls  
    MacOSX Guru Site Information, tips and tricks, FAQ for Mac OS X developers    
 Welcome to MacOSX Guru Site
 Tuesday, September 25 2018 @ 11:37 AM BST

How to change file permissions from Carbon ?

   
Carbon Development FAQIs there a call to access and modify Unix file permission bits ?

OSErr SetFilePermissions( FSRef * ref, UInt32 perm )
{
  FSCatalogInfo  catInfo;
  OSErr err ;

  if ( noErr == (err = FSGetCatalogInfo( ref, kFSCatInfoPermissions, &catInfo, 0, 0, 0 )) )
  {
    catInfo.permissions[2] = (catInfo.permissions[2] & 0xFFFFFE00) | (perm & 0x1FF); // mask off low 9 bits and replace with new ones
    return FSSetCatalogInfo( ref, kFSCatInfoPermissions, &catInfo );
  }
  return err ;
}
 

What's Related

Story Options

How to change file permissions from Carbon ? | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
 Copyright © 2018 MacOSX Guru Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.06 seconds