I use fwh+harbour and need to copy files inside my app.
I try to do on this way , not work:
copy file "c:\*.dbf " to "d:\*.dbf"
not work?!
need help urgent!
thanks a lot
How to copy multiple file with fwh
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: How to copy multiple file with fwh
Code: Select all
#include "Directry.ch"
FUNCTION MAIN()
LOCAL aDir := DIRECTORY( "*.dbf" )
LOCAL i
FOR i = 1 TO LEN( aDir )
COPY FILE ( "c:\" + aDir[ i, F_NAME ] ) TO ( "d:\" + aDir[ i, F_NAME ] )
NEXT
RETURN NIL
Enrico , you are right!
Here is another sample for deleting several file, also work fast
DeleteFiles("c:\myapp\" , "*.ppo")
Funct DeleteFiles(FromWhere,WhatFiles)
local Curdir:= CurDrive()+":\"+CURDIR()+"\"
lChDir(FromWhere) // Ferase work on current dir, so change dir
aFiles := Directory(FromWhere +WhatFiles)
Aeval(aFiles, {|v| Ferase( v[1]) })
lChDir(CurDir) // go back to mydir
Return .t.
Here is another sample for deleting several file, also work fast
DeleteFiles("c:\myapp\" , "*.ppo")
Funct DeleteFiles(FromWhere,WhatFiles)
local Curdir:= CurDrive()+":\"+CURDIR()+"\"
lChDir(FromWhere) // Ferase work on current dir, so change dir
aFiles := Directory(FromWhere +WhatFiles)
Aeval(aFiles, {|v| Ferase( v[1]) })
lChDir(CurDir) // go back to mydir
Return .t.
Lojze