behavior of bin.WriteBytes(array())

Discussion in 'Bug Reports' started by Put Claude, May 20, 2007.

  1. Put Claude

    Put Claude Active Member Licensed User

    hi,

    If the file 'name' has a lenght of 500 bytes, and I rewrite that file with a array
    that is only 150 bytes, like below, I expect the file will be closed after the lenght of the last writed array (150 bytes).
    The file still stays on a file-lenght of 500 bytes... enoying thing...

    FileOpen (c1,name,cRandom) 'open file for binary use
    bin.New1(c1,True) 'make binair file-object
    bin.WriteBytes(igni()) 'writes the complete igni-array binair
    FileClose (c1)

    Of coarse there are work arounds, but is this the normal behavior...

    Put Claude Belgium
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    This is the normal .net behavior.
    You can just add:
    If FileExists(name) Then FileDel(name)
    FileOpen(...
     
  3. Put Claude

    Put Claude Active Member Licensed User

    Hi Erel,

    Thanks, wil do it that way...

    Put Claude Belgium
     
Loading...