From: Earnie B. <ea...@us...> - 2013-07-17 03:15:54
|
On Tue, Jul 16, 2013 at 10:44 PM, Wayne Watson wrote: > I've written a simple C program under Linux, but the data for it is in a > folder C:\MyData. The C program is under /home/Wayne/Project. How do I > get the data to the Linux folder? > There is no one answer for this. It is all up to you to manage. You can either push or pull the data, there are many options to accomplish that with not one being much better than another other than perhaps security measures. My option would be to use scp. > One further question dealing with CRs. Let's say the data looks like > this in Win: > > file abc.txt contains > > 100, 104 > 75, 33 > 18, 92 > > Am I going to need to read this data with the program by using the Linux > EOL? Again, there are options and it is up to you to choose. One is to transform the data from one host EOL to the other before the program consumes it. Another is to make the program smart enough to manage it on its own. One caution, buffered streams should be opened in _O_BINARY mode; if you don't know what that is you should research it. I always open streams in binary mode and manage the CR by replacing it wil null on input. Not many programs care one way or another, some, like notepad, use the CR to know when to move the cursor to the beginning of the next line. It does that because it opens the file in binary mode and operates on the CR data. It is the reason you get a string of one line when opening a file with notepad with LF only line endings. -- Earnie -- https://sites.google.com/site/earnieboyd |