Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 19th, 2006, 9:10 PM   #1
mattysimins
Newbie
 
Join Date: Nov 2006
Posts: 1
Rep Power: 0 mattysimins is on a distinguished road
the FILE * struct.

what is the definition for it so I can control where in the file I'm reading from/writing to?
mattysimins is offline   Reply With Quote
Old Nov 19th, 2006, 9:46 PM   #2
niteice
Programmer
 
niteice's Avatar
 
Join Date: Aug 2005
Posts: 98
Rep Power: 4 niteice is on a distinguished road
Send a message via AIM to niteice
fseek(FILE * stream, long offset, int origin);

stream is a pointer to a FILE.
offset is the number of bytes to seek by. can be negative (so you can seek backwards from current location, for example).
origin is SEEK_SET (beginning of file), SEEK_CUR (current file location), or SEEK_END (end of file).
niteice is offline   Reply With Quote
Old Nov 19th, 2006, 11:10 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I believe this is it, Matty:
typedef struct 
{
        unsigned char   *_ptr;
        int     _cnt;
        unsigned char   *_base;
        unsigned char   *_bufendp;
        short   _flag;
        short   _file;
        int     __stdioid;
        char    *__newbase;
        long    _unused[1];
} FILE;
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 20th, 2006, 1:04 AM   #4
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
The contents of the FILE structure are platform dependent. For example, in the GNU C library it looks completely different and has about 2-3 times the number of fields.
Game_Ender is offline   Reply With Quote
Old Nov 20th, 2006, 10:55 AM   #5
Narue
Professional Programmer
 
Narue's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 Narue is on a distinguished road
>what is the definition for it so I can control where in the file I'm reading from/writing to?
If you have to ask, you don't need to know. If it really bothers you that much, you can write your own stdio. But I'll warn you, it's not exactly a trivial project. You probably want fseek or fgetpos/fsetpos. But their usage can be tricky.
__________________
Even if the voices aren't real, they have some pretty good ideas.
Narue is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OnlineTextEditor.Com! Sane Show Off Your Open Source Projects 43 Jun 16th, 2006 9:55 AM
add mutiple users to the smbpasswd file. Pizentios Bash / Shell Scripting 3 Oct 20th, 2005 1:48 PM
After execution - Error cannot locate /Skin File? wchar Visual Basic 1 Mar 5th, 2005 10:04 PM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 5:12 PM
Structure char field to a disk file ehab_aziz2001 C++ 0 Feb 10th, 2005 3:42 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:50 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC