Xref: utzoo comp.sys.mac.programmer:21499 comp.sys.mac.misc:8316 Path: utzoo!attcan!telly!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!ames!lll-winken!xanth!mcnc!duke!physics.phy.duke.edu!fang From: fang@physics.phy.duke.edu (Fang Zhong) Newsgroups: comp.sys.mac.programmer,comp.sys.mac.misc Subject: Import Binary Date File from PC Message-ID: <21958@duke.cs.duke.edu> Date: 6 Feb 91 06:51:06 GMT Sender: news@duke.cs.duke.edu Followup-To: comp.sys.mac.programmer Organization: Duke University Physics Dept.; Durham, N.C. Lines: 33 Nntp-Posting-Host: physics.phy.duke.edu I use a PC to automate my experiment. I store my data on the PC in binary format as: > fp = fopen(filename, "ab"); > fwrite(&data, sizeof(float), 1,fp); > fclose(fp); I can use: > fread(&data, sizeof(float), 1, fp); to read the data back on PC. I plot my data with Igor on Mac. However, if I use the same line > fread(&data, sizeof(float), 1, fp); to read the data on Mac after the data has been imported via "default translation" of Apple File Exchange, I get garbage. The same is true when I generate binary data on Mac and read it back on PC. This problem exits regardless which mode I use in AFE. Can some experts on the network point out what I didn't right? Thanks in advance. -- Fang Zhong 1-919-684-8247 Duke University Dept. of Physics fang@phy.duke.edu Durham, N.C. 27706