Jump to content

FS READ: Difference between revisions

From EDM2
Created page with "Read the specified number of bytes from a file to a buffer location. ==Syntax== FS_READ(psffsi, psffsd, pData, pLen, IOflag) ==Parameters== ;psffsi :is a pointer to the ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
Read the specified number of bytes from a file to a buffer location.  
{{DISPLAYTITLE:FS_READ}}
Read the specified number of bytes from a file to a buffer location.


==Syntax==
==Syntax==
  FS_READ(psffsi, psffsd, pData, pLen, IOflag)
FS_READ(psffsi, psffsd, pData, pLen, IOflag)
 
==Parameters==
==Parameters==
;psffsi :is a pointer to the file-system-independent portion of an open file instance.  
;psffsi :is a pointer to the file-system-independent portion of an open file instance.
 
;sfi_position :is the location within the file where the data is to be read from. The FSD should update the sfi_position field.
;sfi_position :is the location within the file where the data is to be read from. The FSD should update the sfi_position field.  
;psffsd :is a pointer to the file-system-dependent portion of an open file instance.
 
;pData :is the address of the application data area.
;psffsd :is a pointer to the file-system-dependent portion of an open file instance.  
:Addressing of this data area has not been validated by the kernel (see FSH_PROBEBUF).
 
;pLen :is a pointer to the length of the application data area.
;pData :is the address of the application data area.  
:On input, this is the number of bytes to be read. On output, this is the number of bytes successfully read. If the application data area is smaller than the length, no transfer is to take place. The FSD will not be called for zero length reads. The FSD does not need to verify this pointer.
 
;IOflag :indicates information about the operation on the handle.
:Addressing of this data area has not been validated by the kernel (see FSH_ PROBEBUF).  
:IOflag == 0x0010 indicates write-through
 
:IOflag == 0x0020 indicates no-cache
;pLen :is a pointer to the length of the application data area.  
 
:On input, this is the number of bytes to be read. On output, this is the number of bytes successfully read. If the application data area is smaller than the length, no transfer is to take place. The FSD will not be called for zero length reads. The FSD does not need to verify this pointer.  
 
;IOflag :indicates information about the operation on the handle.  
 
:IOflag == 0x0010 indicates write-through  
:IOflag == 0x0020 indicates no-cache  


==Returns==
==Calling Sequence==
==Sample==
<PRE>
Calling Sequence
<PRE>  
int far pascal FS_READ(psffsi, psffsd, pData, pLen, IOflag)
int far pascal FS_READ(psffsi, psffsd, pData, pLen, IOflag)


Line 35: Line 27:
unsigned short IOflag;
unsigned short IOflag;
</PRE>
</PRE>
==Remarks==
==Remarks==
If read is successful and is a file, the FSD should set ST_SREAD and ST_PREAD to make the kernel time stamp the last modification time in the SFT.  
If read is successful and is a file, the FSD should set ST_SREAD and ST_PREAD to make the kernel time stamp the last modification time in the SFT.


Of the information passed in IOflag, the write-through bit is a mandatory bit in that any data written to the block device must be put out on the medium before the device driver returns. The no-cache bit, on the other hand, is an advisory bit that says whether the data being transferred is worth caching or not.  
Of the information passed in IOflag, the write-through bit is a mandatory bit in that any data written to the block device must be put out on the medium before the device driver returns. The no-cache bit, on the other hand, is an advisory bit that says whether the data being transferred is worth caching or not.


[[Category:IFS Interfaces]]
[[Category:IFS Interfaces]]
{{DISPLAYTITLE:FS_READ}}

Latest revision as of 03:00, 10 February 2020

Read the specified number of bytes from a file to a buffer location.

Syntax

FS_READ(psffsi, psffsd, pData, pLen, IOflag)

Parameters

psffsi
is a pointer to the file-system-independent portion of an open file instance.
sfi_position
is the location within the file where the data is to be read from. The FSD should update the sfi_position field.
psffsd
is a pointer to the file-system-dependent portion of an open file instance.
pData
is the address of the application data area.
Addressing of this data area has not been validated by the kernel (see FSH_PROBEBUF).
pLen
is a pointer to the length of the application data area.
On input, this is the number of bytes to be read. On output, this is the number of bytes successfully read. If the application data area is smaller than the length, no transfer is to take place. The FSD will not be called for zero length reads. The FSD does not need to verify this pointer.
IOflag
indicates information about the operation on the handle.
IOflag == 0x0010 indicates write-through
IOflag == 0x0020 indicates no-cache

Calling Sequence

int far pascal FS_READ(psffsi, psffsd, pData, pLen, IOflag)

struct sffsi far * psffsi;
struct sffsd far * psffsd;
char far * pData;
unsigned short far * pLen;
unsigned short IOflag;

Remarks

If read is successful and is a file, the FSD should set ST_SREAD and ST_PREAD to make the kernel time stamp the last modification time in the SFT.

Of the information passed in IOflag, the write-through bit is a mandatory bit in that any data written to the block device must be put out on the medium before the device driver returns. The no-cache bit, on the other hand, is an advisory bit that says whether the data being transferred is worth caching or not.