flat assembler
Message board for the users of flat assembler.

Index > DOS > File handling

Author
Thread Post new topic Reply to topic
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat 11 Jan 2007, 03:57
Hey y'all, I know how to work with files and what-not using int 21h and the 3C-40h (and possibly more) int modes. One thing I don't understand is that the read and write modes ask for how many bytes to read/write. That leads into my question: Is there a interrupt/int mode that will allow me to get the size of my file?

Thanks!

-Ryan "Rhyno" Lloyd
Post 11 Jan 2007, 03:57
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 11 Jan 2007, 05:17
Quote:
One thing I don't understand is that the read and write modes ask for how many bytes to read/write.


Is it NOT obvious ? Shocked Want to read or write always 64 KB ?

Quote:
That leads into my question: Is there a interrupt/int mode that will allow me to get the size of my file?


http://www.ctyme.com/intr/rb-2600.htm Wink

Works up to 2 GB at best ...

Untested, believe with care ...

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 11 Jan 2007, 05:17
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat 11 Jan 2007, 06:01
Thanks for the help! Smile
Post 11 Jan 2007, 06:01
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 11 Jan 2007, 06:05
The way I know is using http://www.ctyme.com/intr/rb-2799.htm three times. The first time to save the current file pointer, the second time to set the file pointer to the EOF (and saving the return value which is the file size) and third time to set the file pointer back to its original value. This method has no 2 GB limitations (but I see no way of how to get the size of file even larger than 4 GB).
Post 11 Jan 2007, 06:05
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 12 Jan 2007, 01:53
Quote:

The way I know is using
http://www.ctyme.com/intr/rb-2799.htm
three times. The first time to save the current file pointer, the second time to set the file pointer to the EOF (and saving the return value which is the file size) and third time to set the file pointer back to its original value. This method has no 2 GB limitations


Probably better than what I posted above. Wink

Quote:

(but I see no way of how to get the size of file even larger than 4 GB).


There IS a way:

http://www.unet.univie.ac.at/~a0503736/php/drdoswiki/index.php?n=Main.FATplus

Smile Smile

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 12 Jan 2007, 01:53
View user's profile Send private message 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.