News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how overwrite existing file instead of append to it

Started by porphyry5, March 06, 2011, 10:08:38 PM

Previous topic - Next topic

donkey

Quote from: porphyry5 on March 07, 2011, 03:53:04 PM
I take your point, and I'm sure that Donkey's intentions were good, so let me say this:

Donkey, I apologize for reacting sharply when your advice didn't pan out for me; as jj2007 deduced, having then to recreate my input file provoked me to a much tarter response than was appropriate.

All good dude, doesn't really bother me. Opening and closing the handle has little overhead so I would generally do it that way since Windows reacts strangely when simply overwriting a file especially if the new size is smaller than the original.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

porphyry5

Quote from: brethren on March 07, 2011, 01:20:20 PM
It isn't that difficult :wink

I assume you're being ironic.  While I would classify the Intel x86 instruction set as the best designed complex tool I've ever encountered, the Win32 Programmers Reference has to be the worst example of technical writing in history.  I have yet to read anything in it and come away with a sense of certainty as to what any function actually does and does not do.  Maybe after several years daily exposure it becomes easy to read, but so far its only significant effect on me has been to deter my use of assembly, unless the problem absolutely demands it.

porphyry5

Quote from: donkey on March 07, 2011, 04:00:43 PM

All good dude, doesn't really bother me. Opening and closing the handle has little overhead so I would generally do it that way since Windows reacts strangely when simply overwriting a file especially if the new size is smaller than the original.

Great, I'm glad that's cleared up with no hard feelings.   Always have been rather hasty with my responses.

hutch--

The Win32 reference has always been an obscure pig, win31.hlp was even worse so its nothing new. You must get a sniff of old C to read most of it then translate Microsoft Speak trying to describe a multithreading OS to a previous generation that grew up with non-reentrant real mode operating systems. In my generation the shift from old code to SDK C and API formats used to take 3 to 6 months work but once you bashed it in it stayed forever.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

porphyry5

Quote from: hutch-- on March 08, 2011, 01:03:07 AM
In my generation the shift from old code to SDK C and API formats used to take 3 to 6 months work but once you bashed it in it stayed forever.

Hope I can avoid doing that, and won't have to go deeper into the morass than file I/O.  Mostly I code to increase productivity on the computer, scripts for manipulating text and other apps, which gives me a strong bias in favor of console over windows apps.  My assembly coding is limited to jobs that really show up the inefficiency of scripts.  Either way, Long live the command line!