Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rate Thread Display Modes
Old 10-16-2007, 12:59 AM   #1
vishal.chauhan
Triple-A Player
 
Join Date: Jan 2007
Posts: 65
Question open function with O_WRONLY in iPod?

Hi All,

I m workin on MAC Intel having Os 10.4.10.

I have an application in which i m opening the ipod with its name as /dev/rdisk2 and open it in O_WRONLY mode.

But actually it return -1 while opening in write mode but if i open it in read mode then it is working.

If any one knows how I can open it in my application with O_WRONLY then plz help me out.

Thanks.
vishal.chauhan is offline   Reply With Quote
Old 10-16-2007, 02:01 PM   #2
robinwmills
Major Leaguer
 
Join Date: Sep 2007
Location: San Jose, CA, USA.
Posts: 290
Vishal

I'm surprised by this. I don't write to /dev/xxx, I write to /Volumes/<nameofipod>. In fact I have an alias /iPod -> /Volumes/<nameofipod> and then in terminal, I can do:

cd /iPod/Notes
ls -alt ~ > ls.txt
.... ya ya ya ...

All terminal programs seem to be able to read and write to my iPod with my own code. Although I'm using a PowerBook G4 (PPC), I doubt if there's a significant difference between the PPC and the Intel Macs which would causes difficulties. And my code uses fopen("kdkdkd","w") - however I believe the implementation of fopen uses the O_xxxx stuff to which you refer. I'm even delighted to mention that myTouch also works fine! (so I can set the dates correctly).

Have you tried to see if you can write to the iPod. For example:

cd ~
ls -alt > /Volumes/<ipodname>/Notes/myLs.txt

and see if the file in there. Hope that helps.

Robin
robinwmills is offline   Reply With Quote
Old 10-16-2007, 11:36 PM   #3
vishal.chauhan
Triple-A Player
 
Join Date: Jan 2007
Posts: 65
Hi Robin

Actually I m using /dev/rdisk because I doesnot want always to write a file to Ipod . sometime i just want to write 00 to a file .
vishal.chauhan is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 07:57 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.