Skip to Content
Amiga Assembly Library v41.21 — Motorola 68020 shared library for Commodore Amiga

FileInfo

Synopsis

FileInfoBlock = FileInfo(filename) D0 A0

C Prototype

struct FileInfoBlock *FileInfo(STRPTR filename);

Description

This command allocates a FileInfoBlock structure in memory and fills it with information about the file specified in the inputs. The resulting structure is a standard DOS FileInfoBlock, which must be freed using FreeVec().

Inputs

  • filename — Name of the file from which to retrieve the FileInfoBlock.

Result

  • FileInfoBlock — If NULL, an error occurred. Otherwise, it is the address of a FileInfoBlock structure.

See Also

dos.library/Examine(), exec.library/FreeVec()

Implementation

The original 68020 assembly implementation:

; (15-Feb-1995) --- FileInfoBlock = FileInfo(filename) (a0) _LVOFileInfo movem.l d2-d4/a2-a6,-(sp) move.l a0,d4 move.l a6,a5 move.l ab_ExecBase(a5),a6 move.l #fib_SIZEOF+4,d0 move.l d0,d2 moveq #MEMF_PUBLIC,d1 jsr _LVOAllocMem(a6) tst.l d0 ; Rel.2.0 beq.s FileInfo_Exit move.l d0,a4 move.l d2,(a4)+ ; AllocVec() move.l ab_DosBase(a5),a6 move.l d4,d1 moveq #ACCESS_READ,d2 jsr _LVOLock(a6) move.l d0,d4 beq.s FileInfo_Error move.l d0,d1 move.l a4,d2 jsr _LVOExamine(a6) move.l d4,d1 jsr _LVOUnLock(a6) move.l a4,d0 FileInfo_Exit movem.l (sp)+,d2-d4/a2-a6 rts FileInfo_Error move.l ab_ExecBase(a5),a6 move.l a4,a1 move.l -(a1),d0 jsr _LVOFreeMem(a6) moveq #0,d0 movem.l (sp)+,d2-d4/a2-a6 rts
Last updated on