You are not logged in.
include \masm32\include\masm32rt.inc ;mem models, libraries, includes
.data
fname DB "\masm32\include\windows.inc",0 ;target file
.code
start:
call main ; call to proc
inkey ; wait for user
exit ; end
main proc
LOCAL bytecount :DWORD ; stablish a local var
.if rv(exist,ADDR fname) != 0 ; test if file exist
mov bytecount, rv(filesize,ADDR fname) ; use the filesize proc and result is in bytecount
print "Tama?o de WINDOWS.INC = "
print str$(bytecount)," bytes",13,10 ;shows the result
.else
print "ERROR, file doesnt exist",13,10
.endif
ret ; return
main endp
end startenjoy
Offline
I dont know if it is still relevent ..thou there are other ways .. using the dos interrupt to get the file size ..
basiclly you open a file .. and get a file handle and then tell it to move from the beginning of the file to the end
and calculate beginning - end and get how large the file is ..
I think DOS interrupts still work on windows XP ..dont know about vista and 7
Offline