FS CHGFILEPTR: Difference between revisions
Created page with "Move a file's logical read/write position pointer. ==Syntax== FS_CHGFILEPTR(psffsi, psffsd, offset, type, IOflag) ==Parameters== ;psffsi :Is a pointer to the file-system-..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
Move a file's logical read/write position pointer. | {{DISPLAYTITLE:FS_CHGFILEPTR}} | ||
Move a file's logical read/write position pointer. | |||
==Syntax== | ==Syntax== | ||
FS_CHGFILEPTR(psffsi, psffsd, offset, type, IOflag) | FS_CHGFILEPTR(psffsi, psffsd, offset, type, IOflag) | ||
==Parameters== | ==Parameters== | ||
;psffsi | ;psffsi:Is a pointer to the file-system-independent portion of an open file instance. | ||
:Is a pointer to the file-system-independent portion of an open file instance. | :The FSD uses the current file size or sfi_position along with offset and type to compute a new sfi_position. This is updated by the system. | ||
;psffsd:Is a pointer to the file-system-dependent portion of an open file instance. The FSD may store or adjust data as appropriate in this structure. | |||
:The FSD uses the current file size or sfi_position along with offset and type to compute a new sfi_position. This is updated by the system. | ;offset:Is the signed offset to be added to the current file size or position to form the new position within the file. | ||
;type:Indicates the basis of a seek operation. | |||
;psffsd | :type == 0 indicates seek relative to beginning of file. | ||
:Is a pointer to the file-system-dependent portion of an open file instance. The FSD may store or adjust data as appropriate in this structure. | :type == 1 indicates seek relative to current position within the file. | ||
:type == 2 indicates seek relative to end of file. | |||
;offset | :The value of type passed to the FSD will be valid. | ||
:Is the signed offset to be added to the current file size or position to form the new position within the file. | ;IOflag:Indicates information about the operation on the handle. | ||
:IOflag == 0x0010 indicates write-through. | |||
;type | :IOflag == 0x0020 indicates no-cache. | ||
:Indicates the basis of a seek operation. | |||
:type == 0 indicates seek relative to beginning of file. | |||
:type == 1 indicates seek relative to current position within the file. | |||
:type == 2 indicates seek relative to end of file. | |||
:The value of type passed to the FSD will be valid. | |||
;IOflag | |||
:Indicates information about the operation on the handle. | |||
:IOflag == 0x0010 indicates write-through. | |||
:IOflag == 0x0020 indicates no-cache. | |||
Calling Sequence | |||
Calling Sequence | |||
<PRE> | <PRE> | ||
int far pascal FS_CHGFILEPTR(psffsi, psffsd, offset, type, IOflag) | int far pascal FS_CHGFILEPTR(psffsi, psffsd, offset, type, IOflag) | ||
Line 40: | Line 29: | ||
unsigned short IOflag; | unsigned short IOflag; | ||
</PRE> | </PRE> | ||
==Remarks== | ==Remarks== | ||
The file system may want to take the seek operation as a hint that an I/O operation is about to take place at the new position and initiate a positioning operation on sequential access media or read-ahead operation on other media. | The file system may want to take the seek operation as a hint that an I/O operation is about to take place at the new position and initiate a positioning operation on sequential access media or read-ahead operation on other media. | ||
Some DOS mode programs expect to be able to do a negative seek. OS/2 passes these requests on to the FSD and returns an error for OS/2 mode negative seek requests. Because a seek to a negative position is, effectively, a seek to a very large offset, it is suggested that the FSD return end-of-file for subsequent read requests. | Some DOS mode programs expect to be able to do a negative seek. OS/2 passes these requests on to the FSD and returns an error for OS/2 mode negative seek requests. Because a seek to a negative position is, effectively, a seek to a very large offset, it is suggested that the FSD return end-of-file for subsequent read requests. | ||
FSDs must allow seeks to positions beyond end-of-file. | FSDs must allow seeks to positions beyond end-of-file. | ||
The information passed in IOflag is what was set for the handle during a DosOpen/DosOpen2 operation, or by a DosSetFHandState call. | The information passed in IOflag is what was set for the handle during a DosOpen/DosOpen2 operation, or by a [[DosSetFHandState]] call. | ||
[[Category:IFS Interfaces]] | [[Category:IFS Interfaces]] | ||
Latest revision as of 01:28, 9 February 2020
Move a file's logical read/write position pointer.
Syntax
FS_CHGFILEPTR(psffsi, psffsd, offset, type, IOflag)
Parameters
- psffsi
- Is a pointer to the file-system-independent portion of an open file instance.
- The FSD uses the current file size or sfi_position along with offset and type to compute a new sfi_position. This is updated by the system.
- psffsd
- Is a pointer to the file-system-dependent portion of an open file instance. The FSD may store or adjust data as appropriate in this structure.
- offset
- Is the signed offset to be added to the current file size or position to form the new position within the file.
- type
- Indicates the basis of a seek operation.
- type == 0 indicates seek relative to beginning of file.
- type == 1 indicates seek relative to current position within the file.
- type == 2 indicates seek relative to end of file.
- The value of type passed to the FSD will be valid.
- 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_CHGFILEPTR(psffsi, psffsd, offset, type, IOflag) struct sffsi far * psffsi; struct sffsd far * psffsd; long offset; unsigned short type; unsigned short IOflag;
Remarks
The file system may want to take the seek operation as a hint that an I/O operation is about to take place at the new position and initiate a positioning operation on sequential access media or read-ahead operation on other media.
Some DOS mode programs expect to be able to do a negative seek. OS/2 passes these requests on to the FSD and returns an error for OS/2 mode negative seek requests. Because a seek to a negative position is, effectively, a seek to a very large offset, it is suggested that the FSD return end-of-file for subsequent read requests.
FSDs must allow seeks to positions beyond end-of-file.
The information passed in IOflag is what was set for the handle during a DosOpen/DosOpen2 operation, or by a DosSetFHandState call.