Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!oddjob!uwvax!rutgers!bellcore!faline!thumper!ulysses!boris From: boris@ulysses.homer.nj.att.com (Boris Altman) Newsgroups: comp.sys.mac Subject: LSC 3.0 (HELP!) Keywords: C programming problem Message-ID: <10451@ulysses.homer.nj.att.com> Date: 17 Jul 88 00:11:45 GMT Organization: AT&T Bell Laboratories, Murray Hill Lines: 27 I am using latest version of Light Speed C and seem to have a problem with fseek(). I am trying to do very simple thing (he-he-he): FILE *inp; long seek_value; inp=fopen("some_name", "r"); /* check return code -- no problem */ /* some unrelated code */ seek_value=10; /* the file is much longer than 10 char */ fseek (inp, seek_value, 0); at this point fseek returns negative value, I don't know why. Moreover, if I open file as "r+" (which should not make any difference), fseek returns 0, but does not seem to move the "file cursor" ( I tried ftell(..) and it came back with 0.) The same code runs with no problems on VAX or sun. The progam is just read-file, write-file. No user interface to speak of. Am I doing something wrong? IS this a known problem? Any workarounds? Any suggestions? Please reply by mail. Details: Mac+ with 4 meg 20 meg Jasmine (with lots of free space). Thank you in advance. Boris Altman {ucbvax, ihnp4}!ulysses!boris