Jump to content




Recent Status Updates

  • Photo
      15 Nov
    duzamucha

    Hi, I am final year Interior Design Student from University of Huddersfield. I am currently working on my final major project which is going to be linked to coding. I was hoping that you could help me with my research. I have prepared a short survey, it would be a massive help if you could fill it in for me. It takes less than 2 minutes to complete, I promise. Here is the link: https://www.surveymonkey.com/s/73XLJKK Thank you so much in advance!

View All Updates

Developed by TechBiz Xccelerator
Photo
- - - - -

Making a Drive Full!

diskfree tfilestream

This topic has been archived. This means that you cannot reply to this topic.
13 replies to this topic

#13 WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderator
  • 17,278 posts

Posted 08 March 2013 - 10:57 AM

2^32-2 = 4,294,967,294 or about 4GB. Based on Luthfi's earlier answer, I believe we have found the issue.


Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#14 Luthfi

Luthfi

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,320 posts

Posted 08 March 2013 - 08:39 PM

@Saeed:

WingedPanther had summed it up for you. Both your free space sizes surpass the limitation of SetFilePointer (when missing lpDistanceToMoveHigh). Actually it seems that my earlier answer was based from wrong documentation. The online documentation (which url I gave you already) states that the limitation would be (2^31)-2. So, actually the limitation is 2GB-2B. Now we have the answer to what caused the failure in your code.

 

The solution? Make SetFilePointer to use proper lpDistanceToMoveHigh value. I don't recommend to alter TFileStream, so you better rewrite your code to directly use windows api instead of TFileStream.


Edited by LuthfiHakim, 08 March 2013 - 08:39 PM.





Powered by binpress