08-16-2006
confusion (file pointer and file descripter)
Hi everybody,
i am newbie to unix and confused with file pointers and file descripters.
could anyone help me to clear my doubts ..
when we call unix system calls to create a file then we are dealing wih file descripters
i think file descripters are also normals file as stored inhard disks ..... then why we don'tgive them name ( or is it possible to give file pointers a name so that we could use them as normal file name)
waiting for ur reply
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hello All,
I administer my department server and now Im assigned the job of installing a new server. The old server has no home directory but the user accounts are managed using a script and they are partitioned in /fs/grad, /fs/ugrad, /fs/fac, /fs/alumni. But when I finger for a... (1 Reply)
Discussion started by: maybemedic
1 Replies
2. Programming
hi all:
bankpro again,
i want to open a file and close it after an hour (i.e open and close the file ptr)
In the mean time i will be executing my jobs using the shell (CommandInterpreter).
plz help... :cool: (3 Replies)
Discussion started by: bankpro
3 Replies
3. Programming
what is the difference between a file pointer and a file descriptor. (1 Reply)
Discussion started by: bankpro
1 Replies
4. Programming
Hello experts,
I ve a text file I want to go to particular line . what is the best way to do this in c ?
I am tried as follows
fseek ( fh, pos, SEEK_SET);
but this functions moves the file pointer according to a number of bytes. Unfortunately I don't know the exact byte... (7 Replies)
Discussion started by: user_prady
7 Replies
5. Shell Programming and Scripting
Hello all,
I have a script that runs on both the test and production box. The script is owned by a user (abcd for example) with permission set to 700. When this script is run as a root, the log file generated has owner and group as abcdowner and abcdgroup respectively.
Now, when I run the same... (4 Replies)
Discussion started by: solaix14
4 Replies
6. Programming
Hi all,
Can anyone provide help with getting the right syntax regarding array/pointers in C in the following code? Can't locate a specific example which clarifies this...
Say I declare a typedef to an array of pointers to some type...
/**
* An array of ptrs to sections
*/
typedef... (4 Replies)
Discussion started by: gorga
4 Replies
7. UNIX for Dummies Questions & Answers
hi....,
can anyone tell me what is the exact difference between file descriptor and file pointer...... and why file descriptor takes integer value???:confused: (10 Replies)
Discussion started by: jimmyuk
10 Replies
8. UNIX for Dummies Questions & Answers
i have a file in a directory
ls -l gives -rwxr-xr--
so i typed the file name to execute it and i got no such file
but when i type . ./filename i can execute it
what does this . ./ do ?:confused: (15 Replies)
Discussion started by: mithun1!
15 Replies
9. Programming
Here are two programs that pass a pointer to a variable but behave differently. Shouldnt the i in second program be 0 after the function call?
#include<stdio.h>
void changeI(int *i)
{
*i = 10;
}
int main(void)
{
int i=5;
printf("%d before\n", i);
changeI(&i);
printf("%d... (1 Reply)
Discussion started by: dragonpoint
1 Replies
10. UNIX for Dummies Questions & Answers
Hi Friends,
I have a host(Suse Linux 10.4) which has 2 luns presented from 2 different arrays HP eva and xp. we are planning to migrate hp eva to 3par. When i look for physical volume i see /dev/dm-4, /dev/dm-5, /dev/dm-7and when i look for multipath -ll i see dm-8,dm-9,dm-7. So i can't confirm... (6 Replies)
Discussion started by: munna529
6 Replies
LEARN ABOUT XFREE86
glnormalpointer
GLNORMALPOINTER(3G) GLNORMALPOINTER(3G)
NAME
glNormalPointer - define an array of normals
C SPECIFICATION
void glNormalPointer( GLenum type,
GLsizei stride,
const GLvoid *ptr )
PARAMETERS
type Specifies the data type of each coordinate in the array. Symbolic constants GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, and GL_DOUBLE are
accepted. The initial value is GL_FLOAT.
stride Specifies the byte offset between consecutive normals. If stride is 0- the initial value-the normals are understood to be tightly
packed in the array. The initial value is 0.
ptr Specifies a pointer to the first coordinate of the first normal in the array. The initial value is 0.
DESCRIPTION
glNormalPointer specifies the location and data of an array of normals to use when rendering. type specifies the data type of the normal
coordinates and stride gives the byte stride from one normal to the next, allowing vertices and attributes to be packed into a single array
or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays.) When a nor-
mal array is specified, type, stride, and ptr are saved as client-side state.
To enable and disable the normal array, call glEnableClientState and glDisableClientState with the argument GL_NORMAL_ARRAY. If enabled,
the normal array is used when glDrawArrays, glDrawElements, or glArrayElement is called.
Use glDrawArrays to construct a sequence of primitives (all of the same type) from prespecified vertex and vertex attribute arrays. Use
glArrayElement to specify primitives by indexing vertices and vertex attributes and glDrawElements to construct a sequence of primitives by
indexing vertices and vertex attributes.
NOTES
glNormalPointer is available only if the GL version is 1.1 or greater.
The normal array is initially disabled and isn't accessed when glArrayElement, glDrawElements, or glDrawArrays is called.
Execution of glNormalPointer is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an
error is not generated, the operation is undefined.
glNormalPointer is typically implemented on the client side.
Since the normal array parameters are client-side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use
glPushClientAttrib and glPopClientAttrib instead.
ERRORS
GL_INVALID_ENUM is generated if type is not an accepted value.
GL_INVALID_VALUE is generated if stride is negative.
ASSOCIATED GETS
glIsEnabled with argument GL_NORMAL_ARRAY
glGet with argument GL_NORMAL_ARRAY_TYPE
glGet with argument GL_NORMAL_ARRAY_STRIDE
glGetPointerv with argument GL_NORMAL_ARRAY_POINTER
SEE ALSO
glArrayElement(3G), glColorPointer(3G), glDrawArrays(3G), glDrawElements(3G), glEdgeFlagPointer(3G), glEnable(3G), glGetPointerv(3G),
glIndexPointer(3G), glInterleavedArrays(3G), glPopClientAttrib(3G), glPushClientAttrib(3G), glTexCoordPointer(3G), glVertexPointer(3G)
GLNORMALPOINTER(3G)