DosSetFilePtrL: Difference between revisions
Appearance
Created page with "==Description== DosSetFilePtrL moves the read write pointer according to the type of move specified. ==Syntax== <PRE> #define INCL DOSFILEMGR #include os2.h APIRET Do..." |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
DosSetFilePtrL moves the read write pointer according to the type of move specified. | DosSetFilePtrL moves the read write pointer according to the type of move specified. | ||
==Syntax== | ==Syntax== | ||
DosSetFilePtrL (hFile, ib, method, ibActual) | |||
==Parameters== | ==Parameters== | ||
; | ;hFile ([[HFILE]]) input : The handle returned by a previous [[DosOpenL]] function. | ||
;ib ([[LONGLONG]]) input : The signed distance (offset) to move, in bytes. | |||
;method ([[ULONG]]) input : The method of moving. | |||
:Specifies a location in the file from where the ib to move the read/write pointer starts. The values and their meanings are described in the following list: | |||
:*FILE_BEGIN - Move the pointer from the beginning of the file. | |||
:*FILE_CURRENT - Move the pointer from the current location of the read write pointer. | |||
:*FILE_END - Move the pointer from the end of the file. Use this method to determine a file s size. | |||
; ibActual (PLONGLONG) output : Address of the new pointer location. | |||
==Return Code== | ==Return Code== | ||
;ulrc ([[APIRET]]) returns:DosSetFilePtrL returns one of the following values: | |||
* 0 NO_ERROR | |||
DosSetFilePtrL returns one of the following values | * 1 ERROR_INVALID_FUNCTION | ||
* 6 ERROR_INVALID_HANDLE | |||
* 0 | *132 ERROR_SEEK_ON_DEVICE | ||
* | *131 ERROR_NEGATIVE_SEEK | ||
* | *130 ERROR_DIRECT_ACCESS_HANDLE | ||
* 132 | |||
* 131 | |||
* 130 | |||
==Remarks== | ==Remarks== | ||
The read/write pointer in a file is a signed 64-bit number. A negative value for ib moves the pointer backward in the file; a positive value moves it forward. DosSetFilePtrL cannot be used to move to a negative position in the file. | The read/write pointer in a file is a signed 64-bit number. A negative value for ib moves the pointer backward in the file; a positive value moves it forward. ''DosSetFilePtrL'' cannot be used to move to a negative position in the file. | ||
''DosSetFilePtrL'' cannot be used for a character device or pipe. | |||
==Related Functions== | ==Related Functions== | ||
* [[ | * [[DosOpenL]] | ||
* [[ | * [[DosRead]] | ||
* [[ | * [[DosSetFileSizeL]] | ||
* [[ | * [[DosWrite]] | ||
[[Category: | [[Category:Dos]] |
Latest revision as of 22:23, 24 November 2019
DosSetFilePtrL moves the read write pointer according to the type of move specified.
Syntax
DosSetFilePtrL (hFile, ib, method, ibActual)
Parameters
- hFile (HFILE) input
- The handle returned by a previous DosOpenL function.
- ib (LONGLONG) input
- The signed distance (offset) to move, in bytes.
- method (ULONG) input
- The method of moving.
- Specifies a location in the file from where the ib to move the read/write pointer starts. The values and their meanings are described in the following list:
- FILE_BEGIN - Move the pointer from the beginning of the file.
- FILE_CURRENT - Move the pointer from the current location of the read write pointer.
- FILE_END - Move the pointer from the end of the file. Use this method to determine a file s size.
- ibActual (PLONGLONG) output
- Address of the new pointer location.
Return Code
- ulrc (APIRET) returns
- DosSetFilePtrL returns one of the following values:
- 0 NO_ERROR
- 1 ERROR_INVALID_FUNCTION
- 6 ERROR_INVALID_HANDLE
- 132 ERROR_SEEK_ON_DEVICE
- 131 ERROR_NEGATIVE_SEEK
- 130 ERROR_DIRECT_ACCESS_HANDLE
Remarks
The read/write pointer in a file is a signed 64-bit number. A negative value for ib moves the pointer backward in the file; a positive value moves it forward. DosSetFilePtrL cannot be used to move to a negative position in the file.
DosSetFilePtrL cannot be used for a character device or pipe.