WIN API to copy file from A: drive to C:\Folder 
Author Message
 WIN API to copy file from A: drive to C:\Folder

Can you set me on the right track to copy a file from the A: drive to a C:
subdirectory.  Any help would be appreciated.

Richard Brown



Fri, 06 Jul 2001 03:00:00 GMT  
 WIN API to copy file from A: drive to C:\Folder

Quote:

>Can you set me on the right track to copy a file from the A: drive to a C:
>subdirectory.  Any help would be appreciated.

See the COPY(file,New File) command in the LR manual page 536 (in the C5
docs).

HTH
Jerome.



Fri, 06 Jul 2001 03:00:00 GMT  
 WIN API to copy file from A: drive to C:\Folder
Hi, Richard

Quote:
>Can you set me on the right track to copy a file from the A: drive to a C:
>subdirectory.  Any help would be appreciated.

Inside the Global Map (Global Embed) :

  MODULE('Windows.DLL')
    CopyFileA(*CSTRING,*CSTRING,SIGNED),SIGNED,Pascal,RAW
  END

And then, when you want to copy the file :

LOC:SourceFile='source file path'
LOC:NewFile='new file path'
LOC:Resp=CopyFileA(LOC:SourceFile,LOC:NewFile,TRUE)

The last parameter specifies how this operation is to proceed if a
file of the same name already exists. If it's TRUE, the function fails
if the new file exists. If it's FALSE, the function overwrites the
file and succeeds.

Best Regards,

Matas A. Flores
Buenos Aires, Argentina



Fri, 06 Jul 2001 03:00:00 GMT  
 WIN API to copy file from A: drive to C:\Folder
Quote:

> Can you set me on the right track to copy a file from the A: drive to a C:
> subdirectory.  Any help would be appreciated.

In 32 bit is pretty easy:
Copyfile(*cstring,*cstring,bool),bool,pascal
with floppys you have the additional problem of may be no disk in drive. To
suppress the anoying error window use:
!#define SEM_FAILCRITICALERRORS      0x0001
!#define SEM_NOGPFAULTERRORBOX       0x0002
!#define SEM_NOALIGNMENTFAULTEXCEPT  0x0004
!#define SEM_NOOPENFILEERRORBOX      0x8000

oldErrormode = setErrorMode(8001H)
Then latter:
setErrorcode(oldErrormode)
---
Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com



Fri, 06 Jul 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. WIN API to copy all files form A: drive to C:\FOLDER

2. WIN API to create folder on C: drive

3. Copy file from network drive to local drive?

4. Password protect, lock, hide and secure files, folders and drives on your computer 5741

5. Password protect, lock, hide and secure files, folders and drives on your computer 1335

6. How to list files, folders and all their files under the folders

7. Copying folders and files

8. Update two copies of a file in separate folders

9. Question about copying files and folders

10. Copy file from network drive?

11. Copy files from floppy drives

12. Copying Files to another drive

 

 
Powered by phpBB® Forum Software