Seek() behaves different on win32 and Amiga

Report any Hollywood bugs here
Post Reply
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Seek() behaves different on win32 and Amiga

Post 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
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Seek() behaves different on win32 and Amiga

Post by airsoftsoftwair »

Good spot, will be fixed although it probably doesn't affect too many people ;)
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: Seek() behaves different on win32 and Amiga

Post by lazi »

Yeah, not a problem, but good to know about :)
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Seek() behaves different on win32 and Amiga

Post 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()
Post Reply