ok, very cool. the ob command is great i'm glad you showed it. i haven't done anything yet, but am feeling better since i saw that the file was empty. i guess i used a write flag when opening at one point. Thanks for the help so far!
---------- Post updated 04-15-12 at 02:31 PM ---------- Previous update was 04-14-12 at 04:36 PM ----------
This gives me a segmentation fault. Segmentation fault: 11
Any ideas?
---------- Post updated at 02:38 PM ---------- Previous update was at 02:31 PM ----------
Ok, figured it out.
The b was screwing things up. I don't have an array, or what I was reading it into was a length of only 1 and if I did more than 1 with b a segmentation fault would occur? Thats kinda cool because it wasn't with an array.
I'm having trouble with reading information back into a program from a binary file. when i try to display the contents of the file i get a Memory fault(coredump). would anyone be able to assist?
this is my fread line fread(&file_data,sizeof(struct book_type),1,fileSave); ive also tried it without... (3 Replies)
Here's the problem...
I'm using a simulator on UNIX, and it requires a filename where bits are stored, it should read them out and do whatever with them at that point..
So what i'm trying to do is make a binary file on UNIX. On my PC i can use MSDEV, or any of my C++ compilers to generate a... (2 Replies)
Hi All,
I need a solution on my following find command
find ./.. -name '*.file' -print
BTW This gives me the output as belows
./rtlsim/test/ADCONV0/infile/ad0_dagctst.file
./rtlsim/test/ADCONV0/user_command.file
./rtlsim/test/ADCONV0/simv.daidir/scsim.db.dir/scsim.db.file... (2 Replies)
Hi,
I've searched and couldn't find anyone else with this problem. Is there anyway (preferably using ksh - but other script languages would do) that I can read in binary float data into a text file. The data (arrays from various stages of radar processing) comes in various formats, but mainly... (3 Replies)
Hi All,Is there anyway I can conver the binary file to ascii. I don't know the binary file format. file command just lists this as "data" file and when I view it has a lot of non-printable characters.Can I write any command equivalent to wc -l to find out the number of rows in the file?Can I use... (4 Replies)
this is my code and no matter what record number the user enters i cant get any of the records fields to read into the structure acct. What am i doing wrong?
#include <stdio.h>
typedef struct
{
char name;
int number;
float balance;
} acct_info_t;
int main (int... (0 Replies)
Hello to all guys,
Maybe some expert could help me.
I have a working ruby script shown below that reads a big binary file (more than 2GB). The chunks of data I want to analyze
is separated by the sequence FF47 withing the binary. So, in the ruby script is defined as "line separator" =... (10 Replies)
Dear Gurus
I am stuck with the peice of work and do not know from where to start.
I get a machine generated file which is binary file contain binary data, i want to read binary data as it is without converting into any other format.
i want to read byte by byte.
Please let me know what... (24 Replies)
Discussion started by: guddu_12
24 Replies
LEARN ABOUT OSF1
dlsym
dlsym(3) Library Functions Manual dlsym(3)NAME
dlsym - Obtain the address of a symbol from a dlopen() object
SYNOPSIS
#include <dlfcn.h>
void *dlsym(void *handle, const char *name)
PARAMETERS
The value returned from a call to dlopen() (and which has not since been released by a call to dlclose()). The name (character string) of
the symbol being sought.
DESCRIPTION
The dlsym function allows a process to obtain the address of a symbol defined within an object made accessible by a dlopen() call.
The dlsym function will search for the named symbol in all objects loaded automatically as a result of loading the object referenced by
handle (see dlopen(3)). Load ordering is used in dlsym() operations upon the global symbol object. The symbol resolution algorithm used
will be in dependency order as described in dlopen().
RETURN VALUE
The dlsym() function will return NULL, if handle does not refer to a valid object opened by dlopen() or if the named symbol cannot be found
within any of the objects associated with handle. More detailed diagnostic information is available through dlerror().
ERRORS
No errors are defined.
EXAMPLES
The following example shows how one can use dlopen() and dlsym() to access either function or data objects. For simplicity, error checking
has been omitted.
void *handle;
int *iptr, (*fptr)(int);
/* open the needed object */
handle = dlopen("/usr/home/me/libfoo.so.1", RTLD_LAZY);
/* find the address of function and data objects */
fptr = (int (*)(int))dlsym(handle, "my_function");
iptr = (int *)dlsym(handle, "my_object");
/* invoke function, passing value of integer as a parameter */
(*fptr)(*iptr);
APPLICATION USAGE
Special-purpose values for handle are reserved for future use. These values and their meanings are: Specifies the next object after this
one that defines name. This one refers to the object containing the invocation of dlsym(). The next object is the one found upon the
application of a load order symbol resolution algorithm (see dlopen(3)). The next object is either one of global scope - because it was
introduced as part of the original process image or because it was added with a dlopen() operation including the RTLD_GLOBAL flag) - or an
object that was included in the same dlopen() operation that loaded this one. The RTLD_NEXT flag is useful to navigate an intentionally
created hierarchy of multiply defined symbols created through interposition. For example, if a program wished to create an implementation
of malloc() that embedded some statistics gathering about memory allocations, such an implementation could use the real malloc() definition
to perform the memory allocation - and itself only embed the necessary logic to implement the statistics gathering function.
NOTES
Use of the dlsym routine is the preferred mechanism for retrieving symbol addresses. This routine reliably returns the current address of
a symbol at any point in the program, while the dynamic symbol resolution described previously might not function as expected due to com-
piler optimizations. For example, the address of a symbol might be saved in a register prior to a dlopen call, and the saved address might
then be used after the dlopen call - even if the dlopen call changed the resolution of the symbol.
RELATED INFORMATION dlclose(3), dlerror(3), dlopen(3). delim off
dlsym(3)