Hi. I'm new to dcmtk361.
In dcmqrdbi.cc function DB_IdxAdd, there is a call to
[481] DB_lseek (phandle -> pidx, (long) SIZEOF_STUDYDESC, SEEK_SET) ;
but the return value pos is not used. And all 3 parameters are by values.
So, what is the purpose of this function?
DB_lseek
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2503
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DB_lseek
Did you read the comment that is associated with DB_lseek()?
The main purpose of this function is error checking and logging (if there is something the user should be aware of).
Code: Select all
/******************************
* Seek to a file position and do error checking
*
* Motivation:
* We have had situations during demonstrations where size of the DB index file
* has exploded. It seems that a record is being written to a position
* way past the end of file.
* This seek function does some sanity error checking to try to identify
* the problem.
*/
Re: DB_lseek
Dear J. Riesmeier:
Thank you for the quick reply.
I'm trying to access the database through index.dat.
If DB_lseek is only for error checking, is there a
better function I should be using to read an
arbitrary element of the database?
Thank you for the quick reply.
I'm trying to access the database through index.dat.
If DB_lseek is only for error checking, is there a
better function I should be using to read an
arbitrary element of the database?
-
- DCMTK Developer
- Posts: 2503
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DB_lseek
Sorry for being somewhat imprecise in my previous posting. Of course, the call of lseek() is the main purpose of DB_lseek()... but the rest of the function is error checking and logging. Don't ask me why the return value of DB_lseek() is never checked. This code is about 23 years old and has been implemented for demonstration purposes only (e.g. shown at RSNA '93).
Who is online
Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 1 guest