![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing a file descriptor | robotball | Shell Programming and Scripting | 6 | 06-08-2008 07:41 PM |
| File descriptor constant | vino | High Level Programming | 4 | 05-17-2005 10:18 PM |
| Problems with file descriptor | teo | High Level Programming | 11 | 05-09-2005 08:47 AM |
| file activity (open/closed) file descriptor info using KORN shell scripting | Gary Dunn | UNIX for Dummies Questions & Answers | 3 | 06-07-2004 10:54 AM |
| bad file descriptor? | ftb | UNIX for Dummies Questions & Answers | 1 | 02-20-2002 04:19 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
What is a file descriptor in Unix??
How to find a file descriptor of a file in Unix?? Does it have anything to do with the Inode numbers?? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
file
Rathore
u c an use stat structure and find it arun |
|
#3
|
|||
|
|||
|
Mr Arun Thanks for ur reply.
But i dint get it still. Where is this stat structure located. Is it a command. If it is it does n't run in SCO unix. if it is a file where is it located. |
|
#4
|
||||
|
||||
|
If you are familiar with UNIX I/O redirection, syntax similar to the following should not be new to you:
command > file 2>&1 When command runs it sends "normal" output to file, and any error messages generated by command are also written to file. "2>&1" handles the latter. The 2 and 1 are file descriptors. So what's a file descriptor? When a UNIX program wants to use a file, it must first open that file. When it does so, UNIX will associate a number with the file. This number, which is used by the program when reading from and writing to the file, is the file descriptor. A typical UNIX program will open three files when it starts. These files are: - standard input (also known as stdin) - standard output (also known as stdout) - standard error (also known as stderr) Standard input has a file descriptor of 0, standard output uses 1, and the number 2 is used by standard error. |
||||
| Google The UNIX and Linux Forums |