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?
ok also i guess im getting odd results since there are 2 integers i have to acount for in the beggining of the file. how would i get past these with an fseek?
Moderator's Comments:
homework and classwork belong in the homework forum, please post there
Last edited by jim mcnamara; 04-16-2012 at 11:31 PM..
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)
The errors EBADF & ESPIPE occur at this fseek call. Does anybody know how to solve this problem? Thanks in advance.
toFileStream=fdopen(localFileDes,"ra+");
if(fseek(toFileStream, 0, SEEK_END)!=0){
if(errno==EBADF)
printf("errno==EBADF\n");
if(errno==EINVAL)... (3 Replies)
In determining the true file size of a .tga file is the
fseek(fptr,0,SEEK_END);
file_size = ftell(fptr);
combination reliable ? The reason Im asking is because the value of file_size is in agreement with doing a
wc -c mytga.tga
however when I get the value of the extension... (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,
I working a c project in IBM AIX. I have a requirement like this.
I have some contents in *temp. I am writing the contents of *temp to a file pointer ftemp (*ftemp for an tmp file tmpfile.txt)
Now I want to read the contents of *ftemp in the reverse order an dneed to print it in the... (2 Replies)
Hello *nix specialists,
Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 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 OPENDARWIN
acct
ACCT(2) BSD System Calls Manual ACCT(2)NAME
acct -- enable or disable process accounting
SYNOPSIS
#include <unistd.h>
int
acct(const char *file);
DESCRIPTION
The acct() call enables or disables the collection of system accounting records. If the argument file is a nil pointer, accounting is dis-
abled. If file is an existing pathname (null-terminated), record collection is enabled and for every process initiated which terminates
under normal conditions an accounting record is appended to file. Abnormal conditions of termination are reboots or other fatal system prob-
lems. Records for processes which never terminate can not be produced by acct().
For more information on the record structure used by acct(), see /usr/include/sys/acct.h and acct(5).
This call is permitted only to the super-user.
NOTES
Accounting is automatically disabled when the file system the accounting file resides on runs out of space; it is enabled when space once
again becomes available.
RETURN VALUES
On error -1 is returned. The file must exist and the call may be exercised only by the super-user.
ERRORS
Acct() will fail if one of the following is true:
[EPERM] The caller is not the super-user.
[ENOTDIR] A component of the path prefix is not a directory.
[ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters.
[ENOENT] The named file does not exist.
[EACCES] Search permission is denied for a component of the path prefix, or the path name is not a regular file.
[ELOOP] Too many symbolic links were encountered in translating the pathname.
[EROFS] The named file resides on a read-only file system.
[EFAULT] File points outside the process's allocated address space.
[EIO] An I/O error occurred while reading from or writing to the file system.
SEE ALSO acct(5), sa(8)HISTORY
An acct() function call appeared in Version 7 AT&T UNIX.
4th Berkeley Distribution June 4, 1993 4th Berkeley Distribution