473,513 Members | 2,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which is better, using ReadFile/WriteFile or use fstream?

Which is better, using ReadFile/WriteFile or use fstream?

Dec 18 '05 #1
2 2883
monkeydragon wrote:
Which is better, using ReadFile/WriteFile or use fstream?


Well, the answer for this newsgroup would be fstream, since the other
doesn't exist.
On some systems, there might be something called "ReadFile" and "WriteFile",
but those are not portable. OTOH, they might offer more functionality than
the standard fstream, which is designed as the greatest common denominator
of all the systems that a C++ compiler is available for.

Dec 18 '05 #2
For portability, <fstream> is better, while for other like optimization(if
any), the OS API is better.
Your purpose will give you a better answer.

moonrie

"monkeydragon" <ke***********@gmail.com>
??????:11**********************@g44g2000cwa.google groups.com...
Which is better, using ReadFile/WriteFile or use fstream?

Dec 18 '05 #3

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

Similar topics

1
16684
by: Chuck Rittersdorf | last post by:
Hi There I am having a problem using the win32 API from VB6. I am trying to send a command string to a printer(zebra TLP 2742) on LPT1 using the folowing API functions CreateFile and WriteFile I have written C code which works fine, just the VB translation/port
0
587
by: Pankaj Garg | last post by:
I have written a program, where I download reports in PDF or Excel format, depends on user selection. My code is working fine for PDF format, but same code os not working for excel file. When I execute the code, A dialog box appears, itr shows the file name that is same as my aspx file name, with aspx extension (like showreport.aspx), instead...
1
360
by: Claus Pedersen | last post by:
We are building a webapplication but keep hitting a wall: The user can download files but we need to check if they are authorized to do so. We do this with a download-page and use the following code: public void ProcessRequest(HttpContext context) { context.Response.Clear(); context.Response.AppendHeader("Content-Disposition", "attachment;...
3
1638
by: Robert Hanson | last post by:
Hi All, I am using the following: Response.WriteFile(strCompleteFileNameAndPath); Where the strCompleteFileNameAndPath contains something like "C:\\SimpleTest\\Bobtest.doc" and the ContentType is Application/msword. When prompted to save the file, I see the proper file type but the filename is MyWebpage.doc instead of BobTest.doc.
4
5415
by: whoopdaddy | last post by:
We are streaming a PDF file out of an ASPX page in IIS 5 using Response.WriteFile so the user does not need permissions to the directory where the files are stored. This works great when the user is on a fairly fast network connection or when the PDF is not too large. However, for users on slow connections that try to download a large PDF...
0
1044
by: Velavan | last post by:
I am writinging a HTML file into a aspx page using Response.WriteFile. This is used in many pages since it was ported from ASP to ASP.NET. Is there an easy way (minimum cahnges) of processing server side scripts in the include file using Response.Writefile.
1
3260
by: Cindy H | last post by:
Hi I used the code below to automatically open a pdf file when the user clicks on a menu option. It works great on local machine, but when I uploaded it to hosting site and then tried it, I get a 'File download-security warning' window popping up that ask if I want to download or open the file. It wants to download the aspx page itself ,...
10
2029
by: gomzi | last post by:
Hi, I would like to know as to which method is better? Using session objects or cookies for storing information? Which one would be more reliable? And will there be any visible differences in the speed of the website when one option is chosen over the other? Thanks, Gomzi.
7
4105
by: bamusic | last post by:
I am trying to run a programme which is using PGPLOT.When I call it from browser I get following error message. -------- %PGPLOT, Unable to read font file: grfont.dat %PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file. %PGPLOT, PGENV: no graphics device has been selected %PGPLOT, PGBBUF: no...
0
7397
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5704
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.