Re: NSPipe
Re: NSPipe
- Subject: Re: NSPipe
- From: Allan Odgaard <email@hidden>
- Date: Sun, 13 Jun 2004 06:24:47 +0200
On 12. Jun 2004, at 17:58, Daniel Todd Currie wrote:
Setting to /dev/null sounds like what I want to do... Do I just put
that in a file handle, as below?
Yes, that should do!
What exactly is /dev/null?
There is actually a manual entry for 'null':
The null device accepts and reads data as any ordinary (and willing)
file
- but throws it away. The length of the null device is always zero.
So 'cp foo /dev/null' will work, but does nothing, where as 'cp
/dev/null foo' should create a file in the current directory named foo
and with a size of 0.
It is mostly useful for shutting up programs, e.g. if 'cmd' generates
all sorts of verbose output that we do not want, we just redirect
stdout to /dev/null (using '>' in the shell), e.g. 'cmd > /dev/null'.
what is the whole /dev directory for, for that matter?
It is for 'devices'. For example you have disk* files which is raw
access to your harddisks:
% sudo xxd /dev/disk0s1 | head
0000000: 504d 0000 0000 0003 0000 0001 0000 003f PM.............?
0000010: 4170 706c 6500 0000 0000 0000 0000 0000 Apple...........
0000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000030: 4170 706c 655f 7061 7274 6974 696f 6e5f Apple_partition_
0000040: 6d61 7000 0000 0000 0000 0000 0000 0000 map.............
You have a 'device' which just outputs random data:
% xxd /dev/random | head -1
0000000: 3b19 e2c0 b127 5746 55fb f8a7 ef8e 2b50 ;....'WFU.....+P
And all that pty/tty stuff is related to terminal connections (tty =
teletype)...
This is old legacy unix stuff, so you can find much more info if you do
some unix searches.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >NSPipe (From: Daniel Todd Currie <email@hidden>) |
| >Re: NSPipe (From: Allan Odgaard <email@hidden>) |
| >Re: NSPipe (From: Ben Zarzycki <email@hidden>) |
| >Re: NSPipe (From: Daniel Todd Currie <email@hidden>) |