NSFileImmutable (how to set schg not uchg)

I was playing around with NSFileManager and started setting test files immutable flags I realized that even if I was root it wasn't setting the schg flag that chflags gives you the option to set, so my question is, is it possible to set the schg flag with cocoa?

Hi Eric -
I think the ability to set the system immutable flag was added to NSURL in 10.6 (see [setResourceValue:forKey:error:|http://developer.apple.com/mac/library/document ation/Cocoa/Reference/Foundation/Classes/NSURLClass/Reference/Reference.html#//appleref/occ/instm/NSURL/setResourceValue:forKey:error:] and [NSURLIsSystemImmutableKey|http://developer.apple.com/mac/library/documentation /Cocoa/Reference/Foundation/Classes/NSURLClass/Reference/Reference.html#//apple_ref/doc/cref/NSURLIsSystemImmutableKey]). I don't know of any Cocoa method that does this in 10.5 or earlier.
Some info on unsetting that flag, btw:
[OSX FAQ|http://osxfaq.com/Tutorials/LearningCenter/AdvancedUnix/ugp2/page2.ws]
[How to start up in single-user or verbose mode|http://support.apple.com/kb/HT1492]
\- Ray

Similar Messages

  • How to set Mail NOT to download new messages?

    How can I set Mail NOT to automatically download incoming email messages when it opens?
    I have several email accounts turned on within Mail.  My default email is NOT iCloud, and I use another app to manage that account.  However, within other apps, for example, to report a crash, the iPad defaults to Mail to send the report.  That is OK.  However, in the process it starts downloading all my incoming messages.  I want it NOT to do that.
    i want it to download new messages only when I ask it to do so.
    Thanks.

    The iPhone data plans are unlimited, so you shouldnt be concerned about cost. That being said, it is ANNOYING to have all accounts (I have six) check email just because I launch the mail app. And if I follow a URL in an email to Safari, then come back to Mail, it checks AGAIN.
    Nope, there is not way to stop if from doing that short of turning the account OFF under Mail Settings, which is even MORE inconvenient. I went to http://www.apple.com/feedback/iphone.html and left them a message. Perhaps you should do the same.

  • How to set ResultSet not null?

    Hello !
    How can I set my ResultSet null? rs.next( ) is null.
    Thanks in advance.

    "...Hey, do you guys have an idea how to apply operator to method getTime() e.g rs.getTime("TimeOut") - rs.getTime("TimeIn")?..."
    It can't be done.
    One thing you should be checking is whether or not the last value returned from the result set was null, using the wasNull() method.
    If you're getting a NPE, it could be that one of the values you think you're getting back from the database is really null.
    Are you sure you want java.sql.Time? Not java.sql.Timestamp?
    Code it like this:
    java.sql.Timestamp timeIn = rs.getTimestamp("TimeIn");
    java.sql.Timestamp.timeOut = rs.getTimestamp("TimeOut");
    long duration = 0L;
    if ((timeIn != null) && (timeOut != null))
        long millisecondsIn = timeIn.getTime();
        long millisecondsOut = timeOut.getTime();
        duration = millisecondsOut - millisecondsIn;
        assert (duration >= 0L);
    }MOD

  • How to set iTunes not to sync the apps I have on my iPad to my iPhone?

    How can I do this. I always plug my phone in and iTunes transfer the purchased apps to mynlibrary, same with my iPad. Today I wanted to add some songs to both iPhone and iPad so I added them to iTunes library then I synced the iPad with no problem next I pluged in my iPhone and it started syncing apps, and at the top I saw A"installing 123kids" which is a kids app for my daughter on my iPad, I do not want this on my iPhone. Please help I'm confused.

    No, I mean synchronize all the apps that I bought/dowloaded from the App store (in my laptop) on to my iphone. Like my Kindle app or ever note. Do I have to dowload them one by one from the App store on my phone or can they be synchronized/added through Icloud or some how?

  • How to set to NOT use any flash?

    Two questions... sorry, they are dumb:
    1- Does Safari 4.0.5 support flash?
    2- If so, how can you turn it off totally so I can see what web sites might look like on iPad etc with no flash?
    thanks,
    tom

    Tom,
    No dumb questions...
    Yes, Safari 4.0.5 supports Flash but just make sure you have the most recent Flash plugin version installed which is: Adobe Flash Player version 10.0.45.2 You can view installed plugins in Safari by clicking Help/Installed Plugins from the Safari Menu Bar.
    You can install ClicktoFlash but you really don't need to install 3rd party software. If you visit a site that requires the Flash plugin on an iPad, all you will see is a blue square. You may not see the same results on a Mac running Safari with Flash disabled.
    If you watch these videos you'll see what I mean.
    Watch the iPad Keynote video here... http://www.apple.com/ipad/#video
    and here. http://www.apple.com/quicktime/qtv/specialevent0110/
    Carolyn
    Message was edited by: Carolyn Samit

  • How to set JSpinner  not editable?

    hi
    I am using a jspinner - i would like the JSpinner to be enabled but i dont want the user to be able to edit the data inside the spinner.
    I know in combo box when i had this problem i used:
    setEditable(false)
    but i dont see this function in the JSpinner.
    How can i do it? does setting a null editor should help?
    Liat

    i m displaying data to table cells but problem is that they are Editable , any one can change the displayed info .
    so how to stop other from editingIf you are using some custom table model, then override isCellEditable() and return false.
    If you are making table by passing data and column names from the constructor itself, then you would have to change it to following to override isCellEditable():
    JTable table= new JTable(new DefaultTableModel(data, columnNames){
         @Override
         public boolean isCellEditable(int row, int column) {
              return false;
    });Sorry, I don't know of any other shortcut method :)
    Thanks!

  • How to set TextEdit not to open Documents automatically protected

    I get texts for my redactional work that I have to cut&paste from Text Edit into my CMS. Unfortunately under Lion every document is opened in protected mode - causing ths annoying dialogue pop up whenever I "cut" for the first time.
    How can I swith this off - it's really annoying and causing delay to my routine work !

    Go to Time Machine System Prefs and click on the Options button.
    Set the file lock time as you'd like.

  • How to set Sticky Notes open at all times in PDFs

    XP Acrobat 9 Pro Extended
    When I add a sticky note in a PDF, the sticky note always appears as an icon. Can I have sticky notes in a PDF open at all times, meaning when I open the PDF, the sticky notes in the PDF are already open? Can this be done. Thanks.

    In Acrobat's Preferences — play with the selections for "Commenting".
    Be well...

  • How to set itunes not to save genre files' artwork automatically

    i just wonder if there is a way to prevent itunes to not to save genre artworks automatically from the pre-installed file?
    thanx

    ask the users in the iTunes forum: https://discussions.apple.com/community/itunes.  good luck

  • I installed Mountain Lion so that I could sync my notes with my iPhone that already syncs notes with a specific email address I use for school, but during the install it automatically set up Notes to sync w the wrong email addy. How can I fix it?

    I installed Mountain Lion so that I could sync my notes with my iPhone that already syncs notes with a specific email address I use for school, but during the install it automatically set up Notes to sync w the wrong email addy. It looked in Mail, which had 5 email accounts set up in it, and for some reason picked the only one that I no longer use because it is for a school that I no longer attend. How can I fix it so that it syncs with the correct email account for notes and calendar? There don't seem to be any settings available other than to check if you want to use the basic features. It also said during the set up that it was setting up 'find my mac' but if I look on the iCloud website there is nothing showing there for finding my mac.
    At this point I feel like I wasted my money paying for this supposed upgrade. I got nothing for it but frustration. It even automatically set my security settings to allow only downloads from the Mac store so the first time I went to download something I had to stop what I was doing and go correct settings first. I feel like there should be a security setting to block downloads from the Mac store so I don't accidentally end up clicking the wrong thing and being charged.

    iCloud isn't syncing them on your phone.  You simply added the email account to your phone and enabled calendar and notes syncing with the email provider, and the calendar and notes appear in the calendar and notes apps on your phone.  You can do this with Gmail, Yahoo and other IMAP account.  iCloud email is just another IMAP account, but syncs notes with Apple's iCloud server just as Gmail syncs notes and calendars with Google's server.
    iCloud didnt' set up a non-iCloud account on your Mac.  When you check Mail in System Preferences>iCloud, it only creates an iCloud email account.  You can also add other email accounts to your Mac by going to System Preferences>Mail,Contacts,Calendars and clicking on the "+" sign on the bottom of the left sidebar.  If you added these other email accounts to your Mac before you upgraded to Mountain Lion, these were simply maintained on your Mac after you upgraded.

  • How to set up sms sending on yosemite if my country (Kyrgyzstan) is not in the list of supported countries? thanks

    how to set up sms sending on yosemite if my country (Kyrgyzstan) is not in the list of supported countries? thanks

    hello guys, i live in lebanon too and i was so frustrated by this. however i found the solution. when setting up icloud keychain, before creating a password for the keychain press on advanced options and choose not to create a password. you will ahve to use your account password to activate keychain on other device. this will bypass the sms confirmation

  • How to set up just an email account? - it's not working

    Hi there,
    Could someone please let me know how to set up just an email account for a staff member?
    I tried "E-mail Accounts" - Add an email account - but the password verification NEVER comes through. I've tried send password recoved but does not work (ive deleted it and tried 3 different Password recovery e-mails - gmail / local and another BC one too).. nothing is working.
    So then I read the knowledge base which is out of date:
    http://kb.worldsecuresystems.com/000/bc_8.html?bc-partner says to set up an email account you need to go to Site Users (which doesn't exist) to tick "enable email" - so I tried Admin users but it has no email only option..

    Hi Dandy,
    You can still switch to V2 view to find things. Something I am still doing when I do these irregular jobs, as they only happen when a site goes live and that will only be once a month for us. Twice some months.
    Although I just tried going to V2 and getting up the V3 view, but it didn't send me to the page I wanted.
    I notice that there is a new tab in V3 called Email accounts, where you can set up email accounts now. Try there.
    You will need to have the user set up first under Admin Users and User Roles first I expect.
    Also check workflows are set up properly once you have gone into Email Accounts and set up the email address.
    Or maybe just go back to V2 and do it all there. Click in top rh corner to get back to it.

  • How do I set up my airport express to make a connection with my Hp? I already have it set up for my mac laptop just not sure how to set it up so that theres also a connection with my Hp

    how do I set up my airport to make a connection with my Hp? I already have it set up for my mac laptop just not sure how to set it up so that theres also a connection with my Hp

    I set up my new HP Descjet 3054A . I had a problem becouse Apple give me CD as a driver. The thing was that CD wasn good for this printer becouse it was old software:) I had to go to Apple store so the specialist had to download me he wright driver. Becouse I didnt wannet to screw this up . When he downloaded driver I fired it up at house and thingworks perfect. The thing is when you download all the software from HP side . Then you have to connect your MAC to printer via USB . Fallow the instructions it should works. Worked for me. Good Luck!

  • HT5622 hi. i bought iphone 5 witch was locked, i made factory reset and now phone asking apple ID and pasword witch i dont know. i was writing to seller but he is not answering me. how to set new account for my iphone 5 what i could use it?

    hi. i bought iphone 5 witch was locked, i made factory reset and now phone asking apple ID and pasword witch i dont know. i was writing to seller but he is not answering me. how to set new account for my iphone 5 what i could use it?

    The iPhone has a feature called "Activation Lock" described here:
    http://support.apple.com/kb/PH13695
    Without that Apple ID, you will not be able to use that iPhone.

  • How to set up the interaction between InDesign CS6 8.0 and Photoshop CS 6 - if Photoshop is installed and the 64 and 32-bit?? default InDesign refers to the 64-bit version of Photoshop and scripts do not work.

    how to set up the interaction between InDesign CS6 8.0 and Photoshop CS 6 - if Photoshop is installed and the 64 and 32-bit?? default InDesign refers to the 64-bit version of Photoshop and scripts do not work.

    Nice of you to point it out here as I at least don’t follow Mr.Nash’s blog regularly.

Maybe you are looking for