Page 1 of 1

Seek() behaves different on win32 and Amiga

Posted: Mon Mar 14, 2016 7:45 pm
by lazi
If you Seek() over the length of a writeable file, Amiga stops at the file end, while win32 fills the gap with zeros.

Here is a test script:

Code: Select all

OpenFile(1,"test",#MODE_WRITE)
Seek(1,100)
WriteString(1,"DEADBEEF")
CloseFile(1)

DebugPrint(FileSize("test")) 


The results:
AmigaOS4: 8
win32: 108

Re: Seek() behaves different on win32 and Amiga

Posted: Mon Mar 14, 2016 9:29 pm
by airsoftsoftwair
Good spot, will be fixed although it probably doesn't affect too many people ;)

Re: Seek() behaves different on win32 and Amiga

Posted: Tue Mar 15, 2016 12:45 am
by lazi
Yeah, not a problem, but good to know about :)

Re: Seek() behaves different on win32 and Amiga

Posted: Tue Sep 20, 2016 6:15 pm
by airsoftsoftwair

Code: Select all

- Fix [Win32/Linux/MacOS/Android]: Using Seek() to position the cursor after the end of file when
  the file is in write mode actually filled the gap with zeros; this was inconsistent with the
  behaviour on AmigaOS; now it's impossible to position to cursor after the end of file with
  Seek()