Re: Wish I was using .net



Michael,

Two major problems with VB 6 File IO statements. First, they simply
aren't
interoperable with Unix (or IBM MVS) end of line markers. dotNet is.
Second, unless you set len = 1, you can't flush files to disk under
program
control. When writing log files, you either end up with a very, very slow
log file or chance loosing the last few log entries. Yes, both of these
could have been fixed within the construct of the classic BASIC file io
statements, but they were certainly broken in VB 6. I lost count of the
number of times I had to FSO to handle Unix files and I ended up using the
Windows API directly for my logfile class.

Now I'm beginning to understand your problem with VB6 file IO. I just
couldn't understand why FileGet(1, A$, 1) was so superior to Get 1, 1, A$.
You should probably take a short course on binary file IO. It would do you
good (even for .NET development). By the way, I haven't used Line Input #,
nor Input # for about 15 years now. Aside from the additional error trapping
necessary (try opening a file for input that doesn't exist), there is no
comparison in speed. Both Karl and Rick give you samples of how to open your
Unix file and the options of using split, and replace to do what you want.
If the file is not too large, read it at one go. If it is very large read it
in 64K chunks. You would be suprised how fast VB6 file IO is. Using VB6 I
can load a very large file, parse the information, reorganize it, and save
it reorganized in roughly the same time that it takes to copy the file from
the command line. Although binary file IO in .Net is quiet a bit slower than
in VB6 it is still much faster than sequential file IO.

As to Flush, I must admit that it should have been included in VB long ago.
But there is a very simple workaround. Simply close the file and reopen it
after each operation. You would be supprised how fast VB6 can do that. In
fact, if you are creating a log file to which multiple users are writing,
the way to do it is to have each user open it as a locked file, write their
info and close again. Works fine.

Another suggestion, stay away from FSO.

Gary


.



Relevant Pages

  • Re: effing Nader
    ... >>But even after selecting all your thousands of files how are you going ... you can do with unix pipelines. ... Most GUI implementations take a different ... For instance say I have a log file for every day this week and I want to ...
    (rec.arts.sf.fandom)
  • Re: Data Mining for PIX Firewall Logs
    ... Unix application. ... have other utilities on them that make searching through a text log file ... Windows machines to this day still do not offer a good way to parse through ... Logging doesn't require much horsepower at all. ...
    (Pen-Test)
  • Re: Hi all i am having a simple problem please clarify this
    ... big file it is in more than 500mb its a webloic servers log file which ... logwatch - system log analyzer and reporter ... being used for Linux and many types of UNIX. ...
    (comp.unix.programmer)
  • Re: /var mysteriously full - only 7M used - df reports 252M used
    ... >a log file to get free space - and did not stop and restart the ap ... learning things about Unix all the time - and I've first made Unix ... It's a lifetime learning experience. ... Bill Vermillion - bv @ wjv. ...
    (comp.unix.bsd.freebsd.misc)
  • VB6 and UNIX
    ... Does anyone know of any reasonably close implementation of the VB6 language ... I've been asked to research the subject of porting some VB6 server-side ... software to UNIX. ...
    (microsoft.public.vb.enterprise)