Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3A9072B8.16CF2FBC@studserv.uni-stuttgart.de> Date: Mon, 19 Feb 2001 02:11:20 +0100 From: Tilman Utz X-Mailer: Mozilla 4.7 [de] (Win98; I) X-Accept-Language: de,en,fr MIME-Version: 1.0 To: cygwin-Mailing Subject: file-IO and mno-cygwin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all, I have a problem doing file IO with the mno-cygwin flag. Maybe I'm just too stupid to correctly give the path and filename, but please, look for yourself: Given the following code: #include #include using namespace std; int main() { ofstream opstream("c:\example.txt"); if(!opstream) { cerr << "File cannot be opened.\n"; return 1; } opstream << << "Test stream."; opstream.close(); return 0; } I tried several possibilities to specify the filename in ofstream opstream() and have two different results (compiling with: $ gcc test.cpp -o test.exe -I/usr/local/mingw32/include -L/usr/local/mingw32/lib -mno-cygwin -lstdc++): - specifying "c:\example.txt" results in the File cannot be opened message; - specifying "example.txt" or "c:\\example.txt" results in a Windows error but also produces if not already existing an empty 'example.txt file. I hope, you don't consider this off-topic, I finally thought it's a cygwin problem, but unfortunately I didn't find any explanation, workaround... for this in the faq and archives, so, any help would be really apreciated. Tilman PS: I have Win98 SE, cygwin.dll 1.1.7-1, gcc 2.95.2-6 -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple