file inuse

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating a file with identifier+dateandtime, when on multiple requests
at the same time, it fails, it either says file in use , can't be deleted?
can any one of you suggest, how to uniquely define a file name??

Thanks,
Venkat.
 
You can use System.IO.Path.GetTempFileName() to have the system generate an
unique file name.

Gabriel Lozano-Morán
 
It was my mistake to assume that you were talking about temp files. If you
really want an unique filename and you don't care about the size or
structure you can use the static method Guid.NewGuid() this will return you
a new instance of the Guid class use the ToString() method of this class and
use the yielded value as an unique file name.

Gabriel Lozano-Morán
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top