Solved

Device file permissions on mac os x

Posted on 2004-10-28
169 Views
Last Modified: 2013-12-26
I m wanted to read hard disk but unable to read. I m able to read any .txt and .doc file on mac os x.

I have two hard disks attached with my system
/dev/disk0
#: type name size identifier
0: FDisk_partition_scheme *18.6 GB disk0
1: DOS_FAT_32 NO NAME 9.8 GB disk0s1
/dev/disk1
#: type name size identifier
0: Apple_partition_scheme *55.9 GB disk1
1: Apple_partition_map 31.5 KB disk1s1
2: Apple_Driver43 28.0 KB disk1s2
3: Apple_Driver43 28.0 KB disk1s3
4: Apple_Driver_ATA 28.0 KB disk1s4
5: Apple_Driver_ATA 28.0 KB disk1s5
6: Apple_FWDriver 256.0 KB disk1s6
7: Apple_Driver_IOKit 256.0 KB disk1s7
8: Apple_Patches 256.0 KB disk1s8
9: Apple_HFS Macintosh HD 55.9 GB disk1s9

and the file permissions of these device files are
brw-r----- 1 root operator 14, 0 28 Oct 11:41 /dev/disk0
brw-r----- 1 root operator 14, 1 28 Oct 11:41 /dev/disk1

I have tried to change the permissions through root but message is
chmod o+r /dev/disk0
chmod: /dev/disk0: Operation not permitted

How i can change the file permissions.
plz tell how i have to proceed and give solution to the problem described.
thanx
0
Question by:manojchauhan
    6 Comments
     
    LVL 23

    Expert Comment

    by:brettmjohnson
    You already asked this question using a slightly different membername (forbidden on EE, BTW).
    http://oldlook.experts-exchange.com:8080/Programming/Programming_Platforms/Mac_Prog/Q_21184532.html
    0
     

    Author Comment

    by:manojchauhan
    hi sir
       Plz give reply to my question.
       I am using my friends id to solve my problem, he has two ids of expert exchange
    thanx
    0
     
    LVL 2

    Expert Comment

    by:bachra04
    Hi,

    First of All, you can never change the permission of device file (even with root permission).
    This said, if you want to open a device file from your application you can use the following commands:
    Open , read, write and close.

    according to apple:
    "If you know the name of a device file (for example, disk0s2 or mt0) your application can use POSIX functions such as open, read, write, and close to access and control the associated device."

    See this link for more details:
     
    http://developer.apple.com/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/ArchitectOverview/chapter_3_section_7.html

    -BT
    0
     

    Author Comment

    by:manojchauhan
    dear sir
            thanks a lot for giving such a valuable comment. But i  have  changed the device file permissions login through super user. and after giving all rights to the /dev/rdisk0 i m now able to read the hard disk.
          Again thanx a lots for sparing such a valuable time for my question.
    with regards
    0
     
    LVL 2

    Expert Comment

    by:bachra04
    Hi again,

    I'm new to unix but for this question I asked one of my colleagues who is supposed to be an expert in UNIX and he ensured me that it is impossible to change device file permission.
    Anyway, I learned something new.
    Thank you for this information.

    -BT
    0
     
    LVL 1

    Accepted Solution

    by:
    PAQd, 125 points refunded.

    GhostMod
    Community Support Moderator
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
    Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now