![]() |
Creation date comparison for subdirectories
I need to move files from one drive to another. I have an application that will run on a given frequency to do this. Also, i do not want to move files that were moved the last time this application ran. Being that I am fairly new to programming, i figured i would think out loud and hopefully, if I a missing anything (other the grammer) that someone could point it out. Here are the steps I want to accomplish.
1. Check for drives that are mapped 2. Check last run date 3. Run, do a date compairson for each file in each directory on a given directory. If the file is newer, copy, if not, skip. 4. Renew last run date 5. Close I am making this a *.exe file so no one can mess w/ the code. People around here have tendency to think they are fixing things, when they are not. So, all the following is going to be put in a load event. So, for part 3 this is the code I am going to use. :
Dim path As String = "y:\filehere.txt" 'File for checking mapped driveI used the full Class.Object.Method names for learning purposes. In the future will be assigning the Call.Object to variables. Do you think this code will succesffuly get the directories and files and do the comparison? Bassically for each directory it will get a list of files and compare the dates. Once I get the function working, i'll build a "Working Bar" for the user interaction. |
Ok, I got it so that the array's worked and did a file list to a text box for the files in a dir and so on. Here's the code if your interested. I put it in the click event of the uiGoButton.
:
Dim path As StringLet me know what you think. :) |
Here's a screenshot.
http://www.llashram.net/CookBook/Dir...ist%20copy.jpg |
What's with the forward slashes? I was under the impression that Windows uses backslashes.
|
For some odd reason, it didn't care. I couldn't tell you. I know w/ most things it is the "\" .
|
If you're going to use forward-slashes, you don't need to double them up. That only works because Windows treats C:\\WINDOWS as C:\WINDOWS (after the text has been parsed), and I believe all forward-slashes are converted to backslashes when using them in Windows paths.
|
I beleive your right. It just ended up like that when i was having problems with something else. Forgot to change it back since it did't pose any problems. I'm just etstatic that the thing works.
|
| All times are GMT -5. The time now is 12:46 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC