|
|
#1 | |
|
Yeah I like vw's so what?
|
All I need the ability to copy a few files from one directory to another but it needs to do this every 2 seconds or so.... im a complete programing novice but i have access to visual basic.
Thanks
__________________
Quote:
.....\____ ..../__|__\___ ....\(o)___(o)/ |
|
|
|
|
|
|
#2 | |
|
Mahna Mahna
Join Date: Jul 2006
Location: Madison, Wi
Posts: 6,123
|
You need to be a little more specific
Where is the source of the file? Where is the destination of the file? What kind of file is it? Are you looking to "read" the file and write its contents to a different file or do you want to copy the object itself(which brings more questions)? edit: oh yeah, visual studio supports quite a few options for languages... you looking for something in java, c#, .NET...???
__________________
|
|
|
|
|
|
|
#3 |
|
Nerd, Geek, Freak
Join Date: Sep 2005
Location: Finland
Posts: 703
|
Code:
#! /bin/sh
while true; do
cp -dpR source destination
sleep 2
done
If you want to make copying smarter (only copy the files when they're changed), use rsync. Code:
#! /bin/sh
while true; do
rsync -u source destination
sleep 2
done
Code:
n=10 # start copy every N seconds
before=$(date +%s)
while true; do
# copying happens here
after=$(date +%s)
sleep $(( n - after + before ))
before=after # save one call to date
done
__________________
web | cat Christianity, noun: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree. [mad.frog] |
|
|
|
|
|
#4 | |
|
Registered User
Join Date: Mar 2004
Posts: 15,486
|
i would do it with C# and i would make a GUI that allows you to specify the source directory and the target directory for the copy. also, do you want to rename the files each time?
|
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Nov 2007
Posts: 490
|
For maximum ease, I'd just cheat. Make a super-super-simple VB app that has only two functions, a timer, and a bit of code to execute an external batch file. Here's how to do it:
1) Create a new VB project 2) Drag the timer icon onto the main program window 3) Double-click the timer 4) Paste the code below under the timer function - Private Sub Form_Load() Shell ("c:\copything.bat") End Sub (I think that should work, it's been about a year since I last wrote a VB app that called upon other exe's) 5) Add a button to the page, name it "Start" 6) Double-click it, enter timer1.enabled=true 7) Compile, it should work. |
|
|
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Now Available - LEGO® Batman 2 DC Super Heroes� | News | Latest Tech And Game Headlines | 0 | 06-23-12 12:00 AM |
| "GPU has fallen off the bus" error on 650M unless a CUDA program run first | amonakov | NVIDIA Linux | 0 | 06-18-12 06:34 PM |
| OSC's Oakley Super is Tops in Efficiency | News | Latest Tech And Game Headlines | 0 | 06-03-12 04:10 PM |
| Yellowstone Super First to Crunch Local Climate Models | News | Latest Tech And Game Headlines | 0 | 05-30-12 02:40 PM |