Howto create TMP-files using int xxh? 
Author Message
 Howto create TMP-files using int xxh?

I have read that there is an interrupt that creates temporary files
(sorry, couldn't find the exakt servicenumber when I looked for it :-( ).

I'm now like to know how to use it.

I would like to produce this procedure:

Procedure CreateTMPFile(var F : Filetype; var Filename : String);
 begin;
  {Asm code}
  Filename := Name of the created file
 end;

So I can later use Write(f, ...). Filename would probably be in the form
~fhjdfhj.tmp (you know those Windoze like to trough all over your harddrive :) ).
What I curently wants is that asmcode. I do not know how to use BP's filetypes
and DOS FCB and filehandles. :-(

Can someone help me?

I hope I was clear enough. :)

TIA.

/Jonas
+------------------------------------------------------------------------+
| Who? Me?: Jonas Steverud                         | If All is One,      |

| Home....: http://www.*-*-*.com/ %7Ed4jonas |                     |
+------------------------------------------------------------------------+



Wed, 18 Jun 1902 08:00:00 GMT  
 Howto create TMP-files using int xxh?
Is this what you're looking for? It's set up for text files, but should work for other file types.

{-------------------------------------------------------------------------}
{                                                                         }
{    Open a new, temporary, text file for write-only access.  The file    }
{    name is returned to the caller.                                      }
{                                                                         }
{-------------------------------------------------------------------------}
procedure OpenScratch (var FPtr : text;
                       var FNam : string;
                    var Success : boolean);

var
  Regs : registers;
  Handle : integer;
  Len : byte;

begin
  GetDir (0, FNam);
  FNam := FNam + Chr(0);

  with Regs do
  begin
    DS := Seg(FNam[1]);
    DX := Ofs(FNam[1]);
    AH := $5A;
    CX := $0000;
    MsDos (Regs);

    Success := Flags and FCarry = 0;
    if Success then
    begin
      Handle := AX;
      Len := length(FNam);
      Len := Len + 12;
      FNam[0] := chr(Len);

      AX := $3E00;
      BX := Handle;
      MsDos (Regs);

{$I-}
      Assign(FPtr, FNam);
      Append(FPtr);
      Success := IOResult = 0;
{$I+}
    end;
  end;
end;

--
* Bill Decker                        | Customary disclaimer ... etc. *

*     < It isn't procrastination if you put it off right away. >     *
*--------------------------------------------------------------------*



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Create TMP-files (150 lines)

2. Again..HOWTO Create TTable on the fly....

3. Creating xBase (.dbf) files using FieldDefs.Add - Problems with Size

4. HOWTO read from ASCII-File

5. Using Int 21h in interrupts

6. Converting Bytes(?) to Int / Int to Bytes

7. Readln( file, char, char, string[10], int );

8. /tmp/L63701.html

9. please help - create a batch file to create folders

10. Creating executable file + file handling "objects"

11. Creating an index file for a Paradox 5.0 db file in Delphi 1.0

12. Losing File Handles - But I am not using Files

 

 
Powered by phpBB® Forum Software