home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day16 / feof.c < prev    next >
MacBinary  |  2002-08-11  |  1.1 KB  |  [TEXT/LMAN]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Aug 11 11:03:00 2002, modified Sun Aug 11 11:03:00 2002, creator 'LMAN', type ASCII, 632 bytes "feof.c" , at 0x2f8 286 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-4K) default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[LMAN]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 66 65 6f 66 2e 63 | 00 00 00 00 00 00 00 00 |..feof.c|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4c 4d 41 | 4e 00 00 ff ff ff ff 00 |.TEXTLMA|N.......|
|00000050| 00 00 00 00 00 02 78 00 | 00 01 1e b9 7c 2d 24 b9 |......x.|....|-$.|
|00000060| 7c 2d 24 00 00 00 00 00 | 00 00 00 00 00 00 00 00 ||-$.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 20 00 00 00 |........|.... ...|
|00000080| 2f 2a 20 44 65 74 65 63 | 74 69 6e 67 20 65 6e 64 |/* Detec|ting end|
|00000090| 2d 6f 66 2d 66 69 6c 65 | 2e 20 2a 2f 0d 0a 23 69 |-of-file|. */..#i|
|000000a0| 6e 63 6c 75 64 65 20 3c | 73 74 64 6c 69 62 2e 68 |nclude <|stdlib.h|
|000000b0| 3e 0d 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |>..#incl|ude <std|
|000000c0| 69 6f 2e 68 3e 0d 0a 0d | 0a 23 64 65 66 69 6e 65 |io.h>...|.#define|
|000000d0| 20 42 55 46 53 49 5a 45 | 20 31 30 30 0d 0a 0d 0a | BUFSIZE| 100....|
|000000e0| 69 6e 74 20 6d 61 69 6e | 28 20 76 6f 69 64 20 29 |int main|( void )|
|000000f0| 0d 0a 7b 0d 0a 20 20 20 | 20 63 68 61 72 20 62 75 |..{.. | char bu|
|00000100| 66 5b 42 55 46 53 49 5a | 45 5d 3b 0d 0a 20 20 20 |f[BUFSIZ|E];.. |
|00000110| 20 63 68 61 72 20 66 69 | 6c 65 6e 61 6d 65 5b 36 | char fi|lename[6|
|00000120| 30 5d 3b 0d 0a 20 20 20 | 20 46 49 4c 45 20 2a 66 |0];.. | FILE *f|
|00000130| 70 3b 0d 0a 0d 0a 20 20 | 20 20 70 75 74 73 28 22 |p;.... | puts("|
|00000140| 45 6e 74 65 72 20 6e 61 | 6d 65 20 6f 66 20 74 65 |Enter na|me of te|
|00000150| 78 74 20 66 69 6c 65 20 | 74 6f 20 64 69 73 70 6c |xt file |to displ|
|00000160| 61 79 3a 20 22 29 3b 0d | 0a 20 20 20 20 67 65 74 |ay: ");.|. get|
|00000170| 73 28 66 69 6c 65 6e 61 | 6d 65 29 3b 0d 0a 0d 0a |s(filena|me);....|
|00000180| 20 20 20 20 2f 2a 20 4f | 70 65 6e 20 74 68 65 20 | /* O|pen the |
|00000190| 66 69 6c 65 20 66 6f 72 | 20 72 65 61 64 69 6e 67 |file for| reading|
|000001a0| 2e 20 2a 2f 0d 0a 20 20 | 20 20 69 66 20 28 20 28 |. */.. | if ( (|
|000001b0| 66 70 20 3d 20 66 6f 70 | 65 6e 28 66 69 6c 65 6e |fp = fop|en(filen|
|000001c0| 61 6d 65 2c 20 22 72 22 | 29 29 20 3d 3d 20 4e 55 |ame, "r"|)) == NU|
|000001d0| 4c 4c 29 0d 0a 20 20 20 | 20 7b 0d 0a 20 20 20 20 |LL).. | {.. |
|000001e0| 20 20 20 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 | fpri|ntf(stde|
|000001f0| 72 72 2c 20 22 45 72 72 | 6f 72 20 6f 70 65 6e 69 |rr, "Err|or openi|
|00000200| 6e 67 20 66 69 6c 65 2e | 22 29 3b 0d 0a 20 20 20 |ng file.|");.. |
|00000210| 20 20 20 20 20 65 78 69 | 74 28 31 29 3b 0d 0a 20 | exi|t(1);.. |
|00000220| 20 20 20 7d 0d 0a 0d 0a | 20 20 20 20 2f 2a 20 49 | }....| /* I|
|00000230| 66 20 65 6e 64 20 6f 66 | 20 66 69 6c 65 20 6e 6f |f end of| file no|
|00000240| 74 20 72 65 61 63 68 65 | 64 2c 20 72 65 61 64 20 |t reache|d, read |
|00000250| 61 20 6c 69 6e 65 20 61 | 6e 64 20 64 69 73 70 6c |a line a|nd displ|
|00000260| 61 79 20 69 74 2e 20 2a | 2f 0d 0a 0d 0a 20 20 20 |ay it. *|/.... |
|00000270| 20 77 68 69 6c 65 20 28 | 20 21 66 65 6f 66 28 66 | while (| !feof(f|
|00000280| 70 29 20 29 0d 0a 20 20 | 20 20 7b 0d 0a 20 20 20 |p) ).. | {.. |
|00000290| 20 20 20 20 20 66 67 65 | 74 73 28 62 75 66 2c 20 | fge|ts(buf, |
|000002a0| 42 55 46 53 49 5a 45 2c | 20 66 70 29 3b 0d 0a 20 |BUFSIZE,| fp);.. |
|000002b0| 20 20 20 20 20 20 20 70 | 72 69 6e 74 66 28 22 25 | p|rintf("%|
|000002c0| 73 22 2c 62 75 66 29 3b | 0d 0a 20 20 20 20 7d 0d |s",buf);|.. }.|
|000002d0| 0a 0d 0a 20 20 20 20 66 | 63 6c 6f 73 65 28 66 70 |... f|close(fp|
|000002e0| 29 3b 0d 0a 20 20 20 20 | 72 65 74 75 72 6e 20 30 |);.. |return 0|
|000002f0| 3b 0d 0a 7d 0d 0a 0d 0a | 00 00 00 00 00 00 00 00 |;..}....|........|
|00000300| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000310| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|00000320| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|00000330| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000410| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00000420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+