Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 8, 2009, 07:13 AM   #1
subsonix
macrumors 68030
 
Join Date: Feb 2008
Contents of /dev folder, any details somewhere?

Hi,

Does someone know if there are any explaination somewhere of the content in the /dev folder of a standard os X install, including which devices that can be used from programs or commandline?

Last edited by subsonix; Apr 8, 2009 at 07:18 AM.
subsonix is offline   0 Reply With Quote
Old Apr 8, 2009, 10:05 PM   #2
larkost
macrumors 6502a
 
Join Date: Oct 2007
Those are the "raw devices", one way that drivers expose what they are driving to other layers. For the most part you don't want to touch anything in there unless you already know you need to.

Here are a few off the top of my head:

/dev/null -> also known as the bit-bucket. Anything written to here just goes away. This can be useful in scripts when you don't want the output, and want to make sure that it does not pop up somewhere else.

/dev/random -> can be used as a source of random information.

/dev/urandom -> in MacOS X this is the same as /dev/random

/dev/tty* -> the terminals use this to communicate.

/dev/disk* -> these are the disks and volumes before the filesystem drivers get to them, but a little filtered

/dev/rdisk* -> even lower-level access to the stream of bytes on the disks (only useful for cloning operations)

These are all fairly standard for *nix systems. There are usually small differences in them between OSs, but the broad strokes remain the same.
larkost is offline   0 Reply With Quote
Old Apr 9, 2009, 03:38 AM   #3
subsonix
Thread Starter
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by larkost View Post
Those are the "raw devices", one way that drivers expose what they are driving to other layers. For the most part you don't want to touch anything in there unless you already know you need to.

Here are a few off the top of my head:

/dev/null -> also known as the bit-bucket. Anything written to here just goes away. This can be useful in scripts when you don't want the output, and want to make sure that it does not pop up somewhere else.

/dev/random -> can be used as a source of random information.

/dev/urandom -> in MacOS X this is the same as /dev/random

/dev/tty* -> the terminals use this to communicate.

/dev/disk* -> these are the disks and volumes before the filesystem drivers get to them, but a little filtered

/dev/rdisk* -> even lower-level access to the stream of bytes on the disks (only useful for cloning operations)

These are all fairly standard for *nix systems. There are usually small differences in them between OSs, but the broad strokes remain the same.

Thanks

Im reading a book about unix programming at the moment and have come across this. It sees like apple have removed some of the devices from the /dev folder however and are reffering to the i/oKit framework for those devices.

I was just interestred to see what was present but it seems to be mostly related to the terminal and disks as well as some standard connected usb devices. I did try some experiments like with 'cat' to files which revealed a bit about the nature of the particular dev I looked at.
subsonix is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Mavericks not showing all dock folder contents mikebatho OS X Mavericks (10.9) 9 May 24, 2014 07:36 PM
How do I make a folder that can't be deleted and the contents inside it can't either skilledtroll OS X Mavericks (10.9) 9 Nov 29, 2013 05:24 PM
Alphabetical Order for Folder Contents garycurtis OS X 10.8 Mountain Lion 3 Sep 21, 2013 08:04 PM
Will I lose contents of My Secret Folder E Male iOS 7 2 Sep 18, 2013 07:42 PM
New Details Emerge on Security Researcher Potentially Responsible for Dev Center Outage MacRumors MacRumors.com News Discussion 84 Jul 24, 2013 06:34 PM

Forum Jump

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

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC