Sunday, 24 February 2013

Open USB Drive as File using NSWorkplace in Objective-C


i writing application in mac-os using objective-c , read boot-sector of usb drive , modify bytes in it.

created object of nsworkspace, problem how can pass usb-drive path in openfile methods.



 

did mean nsworkspace ?

http://developer.apple.com/library/...es/nsworkspace_class/reference/reference.html

have tried hasn't worked ? sure class want want ? trying achieve think need modify bytes in boot sector of usb flash drive ?

modify device @ such level under unix, require access character device special file present device in "raw" mode. under os x, believe these files /dev/rdisk# # replaced disk number.

nsworkspace doesn't sound need @ all, except maybe list of mounted media using - (nsarray *)mountedremovablemedia method. frankly, won't give dsf usb media. openfile doesn't think does, acts if you've double clicked file.

need bit deeper here, i/o kit api more in-tune want do, along i/o registry :

http://developer.apple.com/library/.../ah_family_reference/ah_family_reference.html

once have info usb device, go standard ansi c or posix stuff manipulate bits in file (fopen()/open(), fseek(), fprintf()/fputc(), fclose()/close()).
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment