473,395 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

what's the .net replacement for ios::nocreate

In the new VC++ 7.0 ios::nocreate is obsolete. Does any one know what
I should do to achieve the same goal? I really want to check if a
file exists before reading from it.

Thanks in advance.
jtreepeace
Jul 22 '05 #1
3 3462

"HLSL fan" <jt********@yahoo.com> wrote in message
news:bc**************************@posting.google.c om...
In the new VC++ 7.0 ios::nocreate is obsolete. Does any one know what
I should do to achieve the same goal? I really want to check if a
file exists before reading from it.

Thanks in advance.
jtreepeace


Try asking in a .net newsgroup. Check the news.microsoft.com server for
available newsgroups.

-Howard

Jul 22 '05 #2

"HLSL fan" <jt********@yahoo.com> wrote in message
news:bc**************************@posting.google.c om...
In the new VC++ 7.0 ios::nocreate is obsolete. Does any one know what
I should do to achieve the same goal? I really want to check if a
file exists before reading from it.

Thanks in advance.
jtreepeace


There is no need for nocreate. If you open a file for reading and the file
doesn't exist, then the open will fail. Nocreate is the default if you like.

john
Jul 22 '05 #3
"John Harrison" <jo*************@hotmail.com> wrote in message news:<2q************@uni-berlin.de>...
"HLSL fan" <jt********@yahoo.com> wrote in message
news:bc**************************@posting.google.c om...
In the new VC++ 7.0 ios::nocreate is obsolete. Does any one know what
I should do to achieve the same goal? I really want to check if a
file exists before reading from it.

Thanks in advance.
jtreepeace


There is no need for nocreate. If you open a file for reading and the file
doesn't exist, then the open will fail. Nocreate is the default if you like.

john


Thank you.

jtreepeace
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: shan | last post by:
#include<fstream> #include<iostream> #include<string> #include<iomanip> #include<stdlib.h> #include<conio.h> #include<stdio.h> using namespace std; class library
10
by: Dave O'Hearn | last post by:
I want to open a file for both reading and writing, but when I do "ios::in|ios::out" with an fstream, it creates the file if it doesn't already exist. I don't like that last part. C's fopen has the...
8
by: Tim Baker | last post by:
Hi, I'm trying to master the basics of file operations, but am coming up with a problem. The code below should request a file to open, then report whether it was successful in opening or not....
10
by: _mario.lat | last post by:
I have a file whith four field in each line: string, int, int, float. For example: age 3 5 3.5 avr 6 7 3.6 .... .... how can I read this file doing something like that:
1
by: Gernot Frisch | last post by:
std::ifstream ifs(cFileMitExtdat, std::ios::nocreate); gives: error C2039: 'nocreate': Is not an element of 'std::basic_ios<_Elem,_Traits>' with
1
by: wongjoekmeu | last post by:
Hello all, I have the following problem. I have a function which being called several times during the run of my program. When the function is called for the first time I want it to create a file...
2
Techshrimp
by: Techshrimp | last post by:
Hlo all! I am in a bit of a jam with my C++ project for school. I am making a very simple program to randomly ask a 25 questions from a file storing any number of questions.Now i have two...
3
dfound
by: dfound | last post by:
#include<windows.h> #include<dos.h> #include<dir.h> #include<fstream.h> #include<stdio.h> #include<process.h> #include"resource.h" //resource header file
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.