Writing files in Windows 10

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    Writing files in Windows 10

    I have just implemented a new system for storing randarts, by writing a text file into the user directory, but it doesn't seem to be working in Windows 10.

    I have tested it in Linux, and macOS, works fine. It is using essentially the same code as for writing the lore file and character dumps, and they both work fine on Windows 10 (and other platforms). When Win 10 tries to write the artifact file, though, it just creates an empty file.

    Does this sound familiar to anyone? Any ideas as to what could be going wrong?
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.
  • Patashu
    Knight
    • Jan 2008
    • 528

    #2
    Stupid question #1: Are you flushing or closing the file at the appropriate time? If you forget to do it, maybe all OSes but Windows 10 do it for you.
    My Chiptune music, made in Famitracker: http://soundcloud.com/patashu

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9637

      #3
      Not at all a stupid question. I suspected something of the sort, and used a different output method in the hope that it would help, and it did. I still don't understand quite why the previous method failed - my knowledge of file handling leaves something to be desired - but it works sufficiently well now so I'm happy.
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • Patashu
        Knight
        • Jan 2008
        • 528

        #4
        Hooray! I was useful!
        My Chiptune music, made in Famitracker: http://soundcloud.com/patashu

        Comment

        Working...
        😀
        😂
        🥰
        😘
        🤢
        😎
        😞
        😡
        👍
        👎