Paul Maddox

Software development team leader specialising in Microsoft Visual C# and C++ from the Northwest of England. Experience working in a globalised business and team; understanding of enterprise business operation and practices; experience reporting to executive management Skills in numerous languages and technologies; knowledge of formal software development lifecycle; experience of architecture design

Tuesday, December 23, 2008

.NET GetTempFileName throws System.IO.IOException: The file exists

Getting an exception System.IO.IOException: The file exists when calling GetTempFileName? I had this problem with a legacy app, despite the call working fine on nearly all of our systems. It turns out the temp directory had been filling with temp files and eventually went bang. From the MSDN:
  • The GetTempFileName method will raise an IOException if it is used to create more than 65535 files without deleting previous temporary files.
  • The GetTempFileName method will raise an IOException if no unique temporary file name is available. To resolve this error, delete all unneeded temporary files.
Simple really.

1 Comments:

  • At April 6, 2009 7:21 PM , Blogger PHenry said...

    Thank you Paul for your blog! You helped me out so much I blogged about it!

    http://www.pchenry.com/Home/tabid/36/EntryID/125/Default.aspx

     

Post a Comment

<< Home