Go Back   AnandTech Forums > Software > Programming

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals
· Free Stuff
· Contests and Sweepstakes
· Black Friday 2013
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 02-18-2013, 04:01 PM   #1
Onceler
Golden Member
 
Onceler's Avatar
 
Join Date: Feb 2008
Posts: 1,233
Default I develop on Windows but my question is may my C code be ported and EOF work on both

I am writing a program that generates a file, will the EOF marker for Linux be readable on a Windows system and vise versa?
Onceler is offline   Reply With Quote
Old 02-18-2013, 04:04 PM   #2
EagleKeeper
Discussion Club Moderator
Elite Member
 
EagleKeeper's Avatar
 
Join Date: Oct 2000
Location: Bumps west of Denver
Posts: 42,600
Default

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
__________________
F15 Air Superiority Fighter - Never has one been lost in aerial combat (104 kills)
EagleKeeper is offline   Reply With Quote
Old 02-18-2013, 06:34 PM   #3
Ken g6
Elite Member
 
Ken g6's Avatar
 
Join Date: Dec 1999
Location: Colorado
Posts: 8,304
Default

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.
__________________
Look for really BIG primes with TeAm AnandTech PrimeGrid!
Next race: April 20-23

vBulletin looking run down? Get your script fix here.
Ken g6 is offline   Reply With Quote
Old 02-18-2013, 06:54 PM   #4
Onceler
Golden Member
 
Onceler's Avatar
 
Join Date: Feb 2008
Posts: 1,233
Default

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.
Onceler is offline   Reply With Quote
Old 02-18-2013, 08:12 PM   #5
Markbnj
Moderator
Programming
 
Markbnj's Avatar
 
Join Date: Sep 2005
Posts: 10,492
Default

Quote:
Originally Posted by EagleKeeper View Post
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.
__________________
Everytime I try to tell you, the words just come out wrong

**
Some meaningless scribbling of no account

The 4th Realm

Arts and Letters Daily - Get some culture
Markbnj is offline   Reply With Quote
Old 02-19-2013, 07:36 AM   #6
EagleKeeper
Discussion Club Moderator
Elite Member
 
EagleKeeper's Avatar
 
Join Date: Oct 2000
Location: Bumps west of Denver
Posts: 42,600
Default

Quote:
Originally Posted by Markbnj View Post
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
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?
__________________
F15 Air Superiority Fighter - Never has one been lost in aerial combat (104 kills)
EagleKeeper is offline   Reply With Quote
Old 02-19-2013, 09:22 AM   #7
Markbnj
Moderator
Programming
 
Markbnj's Avatar
 
Join Date: Sep 2005
Posts: 10,492
Default

Quote:
Originally Posted by EagleKeeper View Post
One reason why I specified the date - demonstrates aging
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.
__________________
Everytime I try to tell you, the words just come out wrong

**
Some meaningless scribbling of no account

The 4th Realm

Arts and Letters Daily - Get some culture

Last edited by Markbnj; 02-19-2013 at 12:49 PM.
Markbnj is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:16 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.