-1

I am writing a port from delphi to c# but i am stuck with this. soFromBeginning?

FStream.Seek(FHeader.DirOffset, soFromBeginning);

soFromBeginning isnt support by c# what can i use as a replacement in a Stream? it seems that soFromBeginning is something in the delphi compiler to accommodate for bigger file sizes or something, not sure.

Porting the GLvfsPack from GLScene to c#

  • 2
    Guessing that soFromBeginning is "Seek-Origin-FromBeginning". The equivalent in .NET `SeekOrigin.Begin` – Keith Payne Mar 11 '14 at 19:43
  • 1
    http://docwiki.embarcadero.com/Libraries/XE5/en/System.Classes.TStream.Seek --> http://msdn.microsoft.com/en-us/library/system.io.stream.seek%28v=vs.110%29.aspx (also : http://msdn.microsoft.com/en-us/library/883dhyx0%28v=vs.110%29.aspx). Gotta love the documentation. – J... Mar 11 '14 at 19:50
  • Where did you read that that identifier has something to do with large files? – Rob Kennedy Mar 11 '14 at 21:44
  • Not sure, in my attempt to find a solution somewhere, i came accross the line, that stated that it had something to do with the 4GB limit or something – Theodor Solbjørg Mar 11 '14 at 22:01
  • @TheodorSolbjørg Very old Delphi `TStream` implementations only had `Seek` with 32 bit offset parameters. You had to use multiple `Seek` from current position to handle large files. Not a lot of fun. – David Heffernan Mar 11 '14 at 22:40

1 Answers1

2

Call the Stream.Seek() method passing SeekOrigin.Begin.

The seek origin is nothing to do with handling large files. It merely specifies how the offset parameter is to be interpreted. Either relative to the start of the file, relative to the end, or relative to the current position.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490