473,396 Members | 1,938 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,396 software developers and data experts.

Log files: leave them open during processing or open-write-close them as needed?

24
Is it better to leave a log file open and shut it down at the end of processing or open it and close it as you write to it?

The object oriented .Net world encourages you open and close as needed. But with my old vb/vbscript apps I left it open.

Thanks for any help
Oct 13 '11 #1
1 1463
Frinavale
9,735 Expert Mod 8TB
I personally think it's better to only keep a file open for as long as it's needed. If you aren't writing to it, then release it.

If you leave it open all the time, and your application crashes at any point, then the file will remain locked.

-Frinny
Oct 13 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Roy Lawson | last post by:
I have no idea what is going on here. I wrote a simple application in VB.NET to generate a Crystal Report, and I am now trying to move it to ASP.NET with Crstal Enterprise. I wish I could tell...
5
by: Praveen | last post by:
I have script files embedded as resources in my dll. During runtime, I would like to write it out into the app dir (or a app sub-dir) and send the appropriate virtual path to the client. This makes...
15
by: Billy | last post by:
Anyone know if this a bug in VB.NET 2002 and how to overcame that situation? I have a MDI form from where I call MDI child form like that: Dim frm As New frmChild() frm.MdiParent = Me...
6
by: Jurgen Haan | last post by:
Hi hi, I'm trying to perform a redirected restore, but I get a nice error returned. Does anyone have an idea of what the -5130 errorcode means? db2inst@ELMO:~> db2 restore db efproddb into...
1
by: Willard Farwark | last post by:
DB2 7.2. I do an export each night of important tables. Nothing else should be touching the DB at this time. About every 2 days I get the error below on the same tables most of the time. What...
9
by: wax | last post by:
Hello. // i/o example #include <iostream> using namespace std; int main () { int i;
1
by: Rob | last post by:
Hi, I've developed a basic dialog program using the MFC foundation wizard. Upon pushing one of the buttons, a time consuming processing is invoked, during which the user cannot access the...
2
Frinavale
by: Frinavale | last post by:
This question may seem a bit newbie-ish but I'm new to desktop applications...please bear with me. I have a function that populates a ComboBox with a bunch of names. To populate it I have to make...
6
by: jtgarrison | last post by:
Is there a way to tell if Outlook is open before sending a message and open it if it's not? I have some old code that I have been using: 'Determine If Outlook Is Open. If Not, Open. Set...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.