This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Trouble Migrating from Windows to Linux
- From: James Cobban <jamescobban at sympatico dot ca>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 16 May 2009 11:11:09 -0700 (PDT)
- Subject: Trouble Migrating from Windows to Linux
I am trying to move a trivial C++ program from Windows to Linux. The program
just reads a specific text file and outputs several text files with an
interpretation of the contents of the file. The only change I made to the
program was the file name to be read and the directory name into which the
output was to be sent. That is on the Windows system the program reads:
"C:/Documents and Settings/Jim Cobban/My
Documents/Archives/Database/SubDistTable1881.csv"
and writes to:
"C:/Documents and Settings/Jim Cobban/My Documents/Archives/Database"
while on Linux it reads:
"~/Windows/Archives/Database/SubDistTable1881.csv"
and writes to:
"~/Windows/Archives/Database"
The output of ls -l ~/Windows/Archives/Database/SubDistTable1881.csv
-rwxrwxrwx 2 jcobban jcobban 23493 2009-05-16 12:59
/home/jcobban/Windows/Archives/Database/SubDistTable1881.csv
On both systems I instantiate an instance of the SpreadSheet object, whose
constructor is:
SpreadSheet::SpreadSheet(const char * fName)
: iFile(fName)
{
if (!iFile.is_open())
std::cerr << "Unable to open input file \""
<< fName << "\"\n";
// first line contains column names
names = getNext();
} // SpreadSheet::SpreadSheet
where iFile is defined in the class header file as:
std::ifstream iFile;
This works on Windows and fails on Linux (Ubuntu 9.04 + gcc (Ubuntu
4.3.3-5ubuntu4) 4.3.3).
I don't know if it is relevant but ~/Windows is a soft-link to "C:/Documents
and Settings/Jim Cobban/My Documents" on an NTFS-3G mounted partition.
--
View this message in context: http://www.nabble.com/Trouble-Migrating-from-Windows-to-Linux-tp23576394p23576394.html
Sent from the gcc - Help mailing list archive at Nabble.com.