Solved

Force File Delete During Move?

Posted on 2006-10-25
1
215 Views
Last Modified: 2010-04-16
I have downloaded updates into a local directory with an appended _ to allow the download to occure without errors.

Now I would like to use something like this: to overwrite the original file...

FileInfo fi = new FileInfo(@"C:\MyProgramRoot\Sub1\");
               
System.IO.File.Move(fi +"new text document.txt_", fi+ "new text document.txt");
0
Comment
Question by:kvnsdr
1 Comment
 
LVL 11

Accepted Solution

by:
Expert1701 earned 125 total points
Comment Utility
I believe you will be limited to:

  System.IO.File.Copy(fi + "new text document.txt_", fi + "new text document.txt", true);
  System.IO.File.Delete(fi + "new text document.txt_");
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now