flat assembler
Message board for the users of flat assembler.

Index > Windows > append data to a text file

Author
Thread Post new topic Reply to topic
mns



Joined: 20 Dec 2007
Posts: 150
Location: Piliyandala,Sri lanka
mns 31 Jul 2011, 10:45
please can someone tell me how to append data to a text file.not overwriting the content
for that
i'v tried to open file like following,
invoke CreateFile,FileName, FILE_APPEND_DATA,FILE_SHARE_READ,NULL,\
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0

but fasm has given following error Crying or Very sad

undefine symbol
pushd FILE_APPEND_DATA



>I,m attaching the whole .asm file


Description:
Download
Filename: exp12.ASM
Filesize: 3.78 KB
Downloaded: 222 Time(s)



Last edited by mns on 01 Aug 2011, 09:07; edited 1 time in total
Post 31 Jul 2011, 10:45
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20361
Location: In your JS exploiting you and your system
revolution 31 Jul 2011, 10:51
Use CreateFile with OPEN_ALWAYS
Then SetFilePointer,[handle],0,0,FILE_END
Then WriteFile,[handle],...
Post 31 Jul 2011, 10:51
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1637
Location: Toronto, Canada
AsmGuru62 31 Jul 2011, 12:00
In addition: FILE_SHARE_READ alone will not allow to append, because appending is actually writing!
Smile
Post 31 Jul 2011, 12:00
View user's profile Send private message Send e-mail Reply with quote
mns



Joined: 20 Dec 2007
Posts: 150
Location: Piliyandala,Sri lanka
mns 31 Jul 2011, 15:17
hey Thank you very much guys for quick and clear responses.I'v got the point.
can any one of you direct me to a good windows assembly(proberbly with FASM)tutorial?
Thanx again.
Post 31 Jul 2011, 15:17
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20361
Location: In your JS exploiting you and your system
revolution 31 Jul 2011, 15:26
AsmGuru62 wrote:
In addition: FILE_SHARE_READ alone will not allow to append, because appending is actually writing!
Only GENERIC_READ and GENERIC_WRITE affect the applications ability to write. Sharing options affect only other handles access to the file.
Post 31 Jul 2011, 15:26
View user's profile Send private message Visit poster's website Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 676
Location: Mar del Plata
Enko 31 Jul 2011, 16:44
for windows, the best asm tutorials are the iczelion's, but they are in masm.

http://win32assembly.online.fr/tutorials.html

there is somewhere in the web, the fasm translation, but I don't thing you will have much problems translating masm to fasm, the important thing are the api calls.
Post 31 Jul 2011, 16:44
View user's profile Send private message Reply with quote
mns



Joined: 20 Dec 2007
Posts: 150
Location: Piliyandala,Sri lanka
mns 01 Aug 2011, 02:53
thanx,
sorry to ask another one,
Is there a way of search a sring in a text file using windows API? Question
Post 01 Aug 2011, 02:53
View user's profile Send private message Send e-mail Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1391
Location: Piraeus, Greece
Picnic 02 Aug 2011, 13:44
mns wrote:
please can someone tell me how to append data to a text file.not overwriting the content

Hi,

Check also here
Post 02 Aug 2011, 13:44
View user's profile Send private message Visit poster's website Reply with quote
mns



Joined: 20 Dec 2007
Posts: 150
Location: Piliyandala,Sri lanka
mns 02 Aug 2011, 17:22
Thanx!!
Post 02 Aug 2011, 17:22
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.