Question

Use a system call Iseek() to move a file pointer to 50 bytes after the beginning of a file? (5 pts) Note that: SEEK SET The f

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The lseek() system call is actually of the following form

lseek(file_name, offset, whence)

file_name is the name of the file

offset is amount the file pointer should move

whence is the way in which offset should be referenced

whence can be SEEK_SET, SEEK_CUR, SEEK_END

Now we have to move 50 bytes from the beginning of the file

Assuming that file is opened for the first time, the file cursor is present at the beginning of the file

The system call would be :

lseek(file_name, 50, SEEK_SET)

Add a comment
Know the answer?
Add Answer to:
Use a system call Iseek() to move a file pointer to 50 bytes after the beginning...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT