c# - Memory-mapped files -> Checking for duplicate file names -
working on app use memory-mapped files inter-(or intra?)application communication, , want make sure when randomly generate memory-mapped memory-only file, don't accidentally generate or duplicate exists (that ultra-rare case when planets align , might happen). ideas on how prevent that? system.io.memorymappedfiles not appear have file.exists() method...i guess try openorcreate() , deal access violations, etc., getting nasty quick.
using file.exists()
wouldn't concurrency-safe anyway.
the best thing do: base filename on guid.
Comments
Post a Comment