dbTalk Databases Forums  

Copying files and folders with VFP

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss Copying files and folders with VFP in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Matt Peeler
 
Posts: n/a

Default Copying files and folders with VFP - 09-29-2004 , 03:52 PM






I am wanting to use VFP6 to copy files and subfolders to my local
drive from the network drive. I am creating a folder using the date
function on my local drive and using the copy file feature works but
it isnt' copying any of the subfolders.

I am doing this
COPY FILE z:\directory1\*.* TO "C:\" + DMY(DATE())+ "DIRECTORY2"


This works when copying the files from one folder to the next but it
won't copy the subfolders. I am using VFP so I can dynamically create
the directory using the date within the code and I can set the exe to
run at night at same time.

Also, where is a good place to find a Visual Foxpro book on version 5
or 6. Any suggestions would be helpful.

thanks

Matt P

Reply With Quote
  #2  
Old   
Martin Gebert
 
Posts: n/a

Default Re: Copying files and folders with VFP - 09-30-2004 , 10:04 AM






Matt Peeler schrieb:
Quote:
COPY FILE z:\directory1\*.* TO "C:\" + DMY(DATE())+ "DIRECTORY2"
Hi Matt,

you need to do the recursive part by yourself, VFP doesn't provide that.
IMHO you should put the filenames and path into paranthesis, else there
could be issues with spaces in the path:

copy file (source) to (target)

Martin


Reply With Quote
  #3  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: Copying files and folders with VFP - 09-30-2004 , 12:28 PM



Or you can use WSH, if available
oFS = CREATEOBJECT('Scripting.FilesystemObject')
oFS.CopyFolder(cSource, cDestination)


hth
-Stefan

"Matt Peeler" <aaronpeel (AT) aol (DOT) com> schrieb
Quote:
I am wanting to use VFP6 to copy files and subfolders to my local
drive from the network drive. I am creating a folder using the date
function on my local drive and using the copy file feature works but
it isnt' copying any of the subfolders.

I am doing this
COPY FILE z:\directory1\*.* TO "C:\" + DMY(DATE())+ "DIRECTORY2"


This works when copying the files from one folder to the next but it
won't copy the subfolders. I am using VFP so I can dynamically create
the directory using the date within the code and I can set the exe to
run at night at same time.

Also, where is a good place to find a Visual Foxpro book on version 5
or 6. Any suggestions would be helpful.

thanks

Matt P

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.