Re: Newbie Header Q's

1998-11-07 Thread Glynn Clements
Andrew Philip Bell wrote: No argument here, but for non (X/Lucid/whatever)Emacs users, tkinfo is very nicely done -- perhaps even Emacs users should check it out for info files. I haven't used tkinfo, so don't construe this as any kind of criticism, but it's almost inconceivable that an

Bus error.

1998-11-07 Thread CyberPsychotic
Hello people, I've got the feeling like I've missed something: so far I understood two actions: gcc foo.c -o foo and gcc -S foo.c gcc foo.s -o foo should produce similar (well almost) code. However, when in latter case I run foo, I get Bus error(core dumped) message. Ideas what goes wrong

file size query

1998-11-07 Thread Leon Breedt
hi again is there a function similar to pascal's filesize() in ANSI C? something that will take a pointer to a stream as parameter, and return the file size in bytes. tia, leon -- __ _ Leon Breedt-o) / / (_)__ __ __ System

FILE * problems...

1998-11-07 Thread Leon Breedt
hi can anyone tell me why this function works: int fopenfile(FILE **fp, char *fname) { *fp = fopen(fname, "r+"); if (!*fp) *fp = fopen(fname, "w+"); /* create if not found */ return 0; } but this one doesnt: int fopenfile(FILE *fp, char *fname) { fp = fopen(fname, "r+");

last question :)

1998-11-07 Thread Leon Breedt
hi again :) what's the fastest way to check for the existence of a file/directory? tia, leon -- __ _ Leon Breedt-o) / / (_)__ __ __ System Administrator /\\/ /__/ / _ \/ // /\ \/ / [EMAIL PROTECTED]_\_v/_/_//_/\_,_/

Checksums

1998-11-07 Thread david
Hello, Can someone explain how to compute checksums and how do they work ? This is for a program i'm working on ( http://www.imaginet.fr/~dramboz/jview) : the program can create databases which are composed of blocks with the same size. I'd like to add a checksum to each block to see if the

Re: last question :)

1998-11-07 Thread ixx
On Sat, Nov 07, 1998 at 05:14:56PM +0200, Leon Breedt wrote: what's the fastest way to check for the existence of a file/directory? I do not know about fastest but stat will work. or you can call open and check for error. or...

Re: Newbie Header Q's

1998-11-07 Thread Glynn Clements
Andrea Arcangeli wrote: still. Beyond that, I don't really use any applications other than XEmacs. And your favourite compiler/interpreter (at least if you don' t use elisp all the time ;-. OK, I should have said `interactive applications'. Everything else gets run in a shell-mode

Re: last question :)

1998-11-07 Thread Glynn Clements
Leon Breedt wrote: what's the fastest way to check for the existence of a file/directory? Use stat(). OTOH, whether a file exists is usually irrelevant. It's usually more meaningful to determine whether the current process can read or write the file (the file may exist, but the permissions

Re: FILE * problems...

1998-11-07 Thread Glynn Clements
Leon Breedt wrote: can anyone tell me why this function works: int fopenfile(FILE **fp, char *fname) { *fp = fopen(fname, "r+"); if (!*fp) *fp = fopen(fname, "w+"); /* create if not found */ return 0; } This will only work if `fp' points to writable memory. If it

Re: FILE * problems...

1998-11-07 Thread david
Leon Breedt wrote: int fopenfile(FILE *fp, char *fname) { fp = fopen(fname, "r+"); if (!fp) fp = fopen(fname, "w+"); /* create if not found */ return 0; } This don't work because 'fp' is passed by value : when you do fopenfile( file, filename); the value of 'file' is copied