Opened 11 years ago

Closed 10 years ago

#2346 closed Feature Request (Completed)

Add native FileSetEnd() based on _WinAPI_SetEndOfFile()

Reported by: Zedna Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


In native AutoIt there were added FileSetPos,FileGePos
so the only one missing native file operation is FileSetEnd.

FileSeEnd can be used (together with FileSetPos) to change size of file (truncating or expanding). Example for this is in HelpFile example for _WinAPI_SetEndOfFile()

Set of all file operation UDF/native functions:

_WinAPI_CloseHandle - FileClose
_WinAPI_FlushFileBuffers - FileFlush
_WinAPI_GetFileSizeEx - FileGetSize
_WinAPI_ReadFile - FileRead
_WinAPI_SetFilePointer - FileSetPos
_WinAPI_WriteFile - FileWrite


Example for change file size by UDF:

#include <WinAPI.au3>

; truncate file size to 12 bytes
$hFile = _WinAPI_CreateFile('test.txt', 2, 4)
_WinAPI_SetFilePointer($hFile, 12)

Attachments (0)

Change History (4)

comment:1 Changed 11 years ago by Zedna

FileSetPos,FileGetPos were added in AutoIt version (20th May, 2009)

comment:2 Changed 11 years ago by Zedna

_WinAPI_SetFilePointer(), _WinAPI_SetEndOfFile()
were added to standard UDF includes in AutoIt version (30th July, 2008)

Here is my topic about proposition for this:

comment:3 Changed 10 years ago by Zedna

Just note:
_WinAPI_CreateFile has native oposite function FileOpen
so the only one missing native file operation function is mentioned FileSetEnd()

comment:4 Changed 10 years ago by Jon

  • Milestone set to
  • Owner set to Jon
  • Resolution set to Completed
  • Status changed from new to closed

Added by revision [10487] in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jon.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.