Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: help Pin
Wes Aday21-Jun-10 16:37
professionalWes Aday21-Jun-10 16:37 
GeneralRe: help Pin
edmagas22-Jun-10 0:20
edmagas22-Jun-10 0:20 
AnswerRe: help Pin
Emilio Garavaglia21-Jun-10 22:35
Emilio Garavaglia21-Jun-10 22:35 
QuestionClient Server Application - Design issue - Writing to a file sequentialy during a session Pin
simon alec smith21-Jun-10 10:01
simon alec smith21-Jun-10 10:01 
AnswerRe: Client Server Application - Design issue - Writing to a file sequentialy during a session Pin
Moak21-Jun-10 11:43
Moak21-Jun-10 11:43 
AnswerRe: Client Server Application - Design issue - Writing to a file sequentialy during a session Pin
«_Superman_»21-Jun-10 18:08
professional«_Superman_»21-Jun-10 18:08 
AnswerRe: Client Server Application - Design issue - Writing to a file sequentialy during a session Pin
ThatsAlok21-Jun-10 20:09
ThatsAlok21-Jun-10 20:09 
AnswerRe: Client Server Application - Design issue - Writing to a file sequentialy during a session Pin
Aescleal22-Jun-10 0:59
Aescleal22-Jun-10 0:59 
As the others have mentioned keeping the file open will be faster but second will be more secure if something goes wrong.

You might be able to get some of the the performance of keeping the file open with opening and closing it every time by opening the file unbuffered. This[^] has got loads of useful info about the pain in the neck this is to sector align buffers if you're on windows. You can do something similar on Linux with the open() system call.

It all depends on how much money's involved if something goes wrong and how much the customer is willing to pay for security. Another solution might be to open and close the file every transaction and make sure the powers that be spend the money they'd have spent on you engineering a software solution on more memory for the server to reduce the impact of repeated opens and closes.

Another option might be to try the double open trick that used to work years ago on some Unixen and DOS. You'll have to see if this does any good, I've not used it on any version of windows since Windows '95. What you do is open the file when the program starts. This makes a second opening really quick when you write a transaction. when you finish writing the transaction you close the file which flushes it to disk. Finally when the program terminates you close the original opening.

Cheers,

Ash
Questionmy thread doesnt work Pin
Krauze21-Jun-10 6:27
Krauze21-Jun-10 6:27 
AnswerRe: my thread doesnt work Pin
Joe Woodbury21-Jun-10 7:57
professionalJoe Woodbury21-Jun-10 7:57 
GeneralRe: my thread doesnt work Pin
Krauze21-Jun-10 16:54
Krauze21-Jun-10 16:54 
GeneralRe: my thread doesnt work Pin
Joe Woodbury21-Jun-10 18:24
professionalJoe Woodbury21-Jun-10 18:24 
GeneralRe: my thread doesnt work Pin
Iain Clarke, Warrior Programmer21-Jun-10 21:24
Iain Clarke, Warrior Programmer21-Jun-10 21:24 
GeneralRe: my thread doesnt work Pin
Niklas L21-Jun-10 22:12
Niklas L21-Jun-10 22:12 
GeneralRe: my thread doesnt work Pin
Iain Clarke, Warrior Programmer21-Jun-10 22:24
Iain Clarke, Warrior Programmer21-Jun-10 22:24 
GeneralRe: my thread doesnt work Pin
Niklas L21-Jun-10 22:38
Niklas L21-Jun-10 22:38 
QuestionMessage Removed Pin
21-Jun-10 5:52
Kausik4u21-Jun-10 5:52 
AnswerRe: Having Issue in Calling JScript from C++ Win32 Project Pin
David Crow21-Jun-10 6:19
David Crow21-Jun-10 6:19 
GeneralRe: Having Issue in Calling JScript from C++ MFC Application using IWebBrowser2 Pin
Kausik4u21-Jun-10 8:09
Kausik4u21-Jun-10 8:09 
GeneralRe: Having Issue in Calling JScript from C++ MFC Application using IWebBrowser2 Pin
enhzflep21-Jun-10 17:45
enhzflep21-Jun-10 17:45 
GeneralRe: Having Issue in Calling JScript from C++ MFC Application using IWebBrowser2 Pin
David Crow23-Jun-10 5:11
David Crow23-Jun-10 5:11 
QuestionProblem to run service on Windows 2008 Server Pin
Mahesh Kulkarni21-Jun-10 5:14
Mahesh Kulkarni21-Jun-10 5:14 
AnswerRe: Problem to run service on Windows 2008 Server Pin
Mahesh Kulkarni22-Jun-10 3:00
Mahesh Kulkarni22-Jun-10 3:00 
GeneralRe: Problem to run service on Windows 2008 Server Pin
Emilio Garavaglia22-Jun-10 4:06
Emilio Garavaglia22-Jun-10 4:06 
QuestionCListBox Ownerdraw doesnt show selected item Pin
maycockt21-Jun-10 3:01
maycockt21-Jun-10 3:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.