Author Topic: File access after loading the stream  (Read 299 times)


  • Posts: 320
File access after loading the stream
« on: 16 Jul '21 - 14:02 »
Hello,  ;D

I've noticed a difference in behaviour between version 2.4.13 and version 2.4.14 (and newer versions): in the older version, when a sound file was loaded through the BASS_StreamCreateFile function, there was no possibility to rename and/or delete the audio file from the hard disk due to an access violation; starting from version 2.4.14 the delete operation is now possible and the stream created from the file continues playing till its end. I've tested this using the "basstest" sample.

Is this a known behaviour or is this in error? I seem to remember that with older versions the file was not sampled and was not fully loaded in memory.

Thanks and Kind Regards  ;D


Ian @ un4seen

  • Administrator
  • Posts: 23920
Re: File access after loading the stream
« Reply #1 on: 16 Jul '21 - 14:36 »
BASS opens the file with FILE_SHARE_DELETE permission these days, which allows the file to be "deleted" while BASS is streaming it. Windows won't actually delete the file until all handles to it are closed, eg. when BASS_StreamFree is called.