FileStream Exists Error Work Around?
Posted on 2006-10-25
The "CreateNew" throws an error when identical files exist in the destination directory as it should.
Problem: I need some method to direct traffic (so to speak) like: IF (!FILE.EXISTS)
System.IO.FileStream fs = null;
byte byteArray = null;
foreach (string file in arraylist1)
byteArray = (f);
fs = new FileStream("C:\\" + file, FileMode.CreateNew, FileAccess.ReadWrite);
if (byteArray != null)
IF (!FILE.EXISTS) // Write file otherwise skip to next array file
fs.Write(byteArray, 0, byteArray.Length);