I develop on Windows but my question is may my C code be ported and EOF work on both

Onceler

Golden Member
Feb 28, 2008
1,262
0
71
I am writing a program that generates a file, will the EOF marker for Linux be readable on a Windows system and vise versa?
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
The EOF is a code that both file systems should recognize.

Now a *nx file may not be directly readable on a windows platform.
We used to have to send the files across TCP/IP between platforms back in the 90's. Unsure if that issue still exists
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,472
4,323
75
If your file is a text file, you may run into the CRLF/LF issue. This can be manually solved with the "unix2dos"/"dos2unix" programs. Otherwise you may want to check for an extra CR (Carriage Return) character in case you need to discard it.
 

Onceler

Golden Member
Feb 28, 2008
1,262
0
71
it will be a binary file the object is to have it readable on both systems without the ctrl-z ctrl-d being a problem.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
The EOF is a code that both file systems should recognize.

Now a *nx file may not be directly readable on a windows platform.
We used to have to send the files across TCP/IP between platforms back in the 90's. Unsure if that issue still exists

Sounds like you were curing an endian-ness problem by calling hton* on one side and ntoh* on the other. You were probably using a version of Unix that is big-endian. Windows and most versions of Linux on x86 architectures are all little-endian, so it shouldn't be an issue for most cases now.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Sounds like you were curing an endian-ness problem by calling hton* on one side and ntoh* on the other. You were probably using a version of Unix that is big-endian. Windows and most versions of Linux on x86 architectures are all little-endian, so it shouldn't be an issue for most cases now.

One reason why I specified the date - demonstrates aging :oops:
Very few version of *nx existed at the time on a x86. we had SCO at the timeon a x86.
The files though were on some mainframe that were being used.

Would the Mac line have the same issue?
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
One reason why I specified the date - demonstrates aging :oops:
Very few version of *nx existed at the time on a x86. we had SCO at the timeon a x86.
The files though were on some mainframe that were being used.

Would the Mac line have the same issue?

OS X on Intel is also little endian. OS X and earlier systems on power pc and Motorola architectures were big endian.
 
Last edited: