Copy file from network drive to local drive? 
Author Message
 Copy file from network drive to local drive?

Using CW2003.  I need to copy a file from the network to the local drive
from a CW program running on the local drive.  I have tried the code
below and several variations but either I get compiler errors or it
doesn't work because it doesn't know where Company is.  Company is on
the network drive and I need to copy it to the local drive.  T: is the
mapped network drive.

COPY('T:\Company','E:\CW20\APPS\Tow')

How do I do this?

Gary



Mon, 04 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
Quote:

> COPY('T:\Company','E:\CW20\APPS\Tow')

the reason it doesnt work is copy is part of command.com. It's not a
stand alone program. If your using 32 bit, use CopyFile() api.
-------
Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com


Tue, 05 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
Hi Gary,

Quote:
> Using CW2003.  I need to copy a file from the network to the local drive
> from a CW program running on the local drive.  I have tried the code
> below and several variations but either I get compiler errors or it
> doesn't work because it doesn't know where Company is.  Company is on
> the network drive and I need to copy it to the local drive.  T: is the
> mapped network drive.

> COPY('T:\Company','E:\CW20\APPS\Tow')

> How do I do this?

    As I recall in CW2.003 the format of COPY command was:
COPY(file,new filename).
    As file you must support a file label from your DCT, not a string with
full path,ie COPY(MyFile,'E:\CW20\APPS\Tow'). Such format as you'v write
above I see in C5, ie COPY(filename,newfilename). In 2.003 you can :
    1. Define a file in DCT
MyFile    DRIVER(...),...,NAME(GLO:FileName)
GLO:FileName     STRING(64)

CODE
    ...
   GLO:FileName = 'T:\Company'
   COPY(MyFile,'E:\CW20\APPS\Tow')

    But may be I'm not right, I'v already forgot CW2.003 ;(

Regards,

Anton Novikov



Tue, 05 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
Hi, Gary!

Follow Anton's advice (and read the Help), and also check for errors so
you'll know why it's not working if it doesn't copy the file.

Jim Johnson

|Using CW2003.  I need to copy a file from the network to the local drive
|from a CW program running on the local drive.  I have tried the code
|below and several variations but either I get compiler errors or it
|doesn't work because it doesn't know where Company is.  Company is on
|the network drive and I need to copy it to the local drive.  T: is the
|mapped network drive.
|
|COPY('T:\Company','E:\CW20\APPS\Tow')
|
|How do I do this?
|
|Gary



Tue, 05 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
Hi Gary,

You could use the api for Copy file (32bit)
Follow the info below:

!Global embed:     Inside the Global Map:

  MODULE('API')

CopyFile(*CSTRING,*CSTRING,SHORT),SHORT,PROC,DLL,RAW,Pascal,NAME('CopyFileA'
)

  END

! Procedure Embed:
SourceFile = 'T:\Company'
Destination = 'E:\CW20\APPS\Tow'     ! SourceFile and Destination = CSTRING
retcode=  CopyFile( SourceFile, Destination , 0 )

Regards,
Johannes Boe


Quote:
>Using CW2003.  I need to copy a file from the network to the local drive
>from a CW program running on the local drive.  I have tried the code
>below and several variations but either I get compiler errors or it
>doesn't work because it doesn't know where Company is.  Company is on
>the network drive and I need to copy it to the local drive.  T: is the
>mapped network drive.

>COPY('T:\Company','E:\CW20\APPS\Tow')

>How do I do this?

>Gary



Tue, 05 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
There is a template called Powerrun by Greg Brethume
('http://members.aol.com/GBerthume')
This is a very inexpensive template which will allow you to run dos
commands in the background. You can place your copy commands in a bat
file and run from there.
David
Quote:

> Hi Gary,

> > Using CW2003.  I need to copy a file from the network to the local drive
> > from a CW program running on the local drive.  I have tried the code
> > below and several variations but either I get compiler errors or it
> > doesn't work because it doesn't know where Company is.  Company is on
> > the network drive and I need to copy it to the local drive.  T: is the
> > mapped network drive.

> > COPY('T:\Company','E:\CW20\APPS\Tow')

> > How do I do this?

>     As I recall in CW2.003 the format of COPY command was:
> COPY(file,new filename).
>     As file you must support a file label from your DCT, not a string with
> full path,ie COPY(MyFile,'E:\CW20\APPS\Tow'). Such format as you'v write
> above I see in C5, ie COPY(filename,newfilename). In 2.003 you can :
>     1. Define a file in DCT
> MyFile    DRIVER(...),...,NAME(GLO:FileName)
> GLO:FileName     STRING(64)

> CODE
>     ...
>    GLO:FileName = 'T:\Company'
>    COPY(MyFile,'E:\CW20\APPS\Tow')

>     But may be I'm not right, I'v already forgot CW2.003 ;(

> Regards,

> Anton Novikov




Tue, 05 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
Hi Johannes,

How about creating new directories using API other than using the RUN
command, is it possible? Thank you.


Quote:
> Hi Gary,

> You could use the api for Copy file (32bit)
> Follow the info below:

> !Global embed:     Inside the Global Map:

>   MODULE('API')

CopyFile(*CSTRING,*CSTRING,SHORT),SHORT,PROC,DLL,RAW,PASCAL,NAME('CopyFileA'
Quote:
> )

>   END

> ! Procedure Embed:
> SourceFile = 'T:\Company'
> Destination = 'E:\CW20\APPS\Tow'     ! SourceFile and Destination =
CSTRING
> retcode=  CopyFile( SourceFile, Destination , 0 )

> Regards,
> Johannes Boe


> >Using CW2003.  I need to copy a file from the network to the local drive
> >from a CW program running on the local drive.  I have tried the code
> >below and several variations but either I get compiler errors or it
> >doesn't work because it doesn't know where Company is.  Company is on
> >the network drive and I need to copy it to the local drive.  T: is the
> >mapped network drive.

> >COPY('T:\Company','E:\CW20\APPS\Tow')

> >How do I do this?

> >Gary



Wed, 06 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
Hi Alvin,

You could use the internal clarion defined APi's.
The best way is to check that the directory do NOT exist and then create it.

!Global Embed:     Inside the Global Map:
MODULE('')
  XXAccess(*CSTRING,SHORT=0),SHORT,RAW,NAME('_access'),PROC
  XXMkDir(*CSTRING),SHORT,RAW,NAME('_mkdir'),PROC
  XXRename(*CSTRING,*CSTRING),SHORT,RAW,NAME('_rename'),PROC
  XXRmDir(*CSTRING),SHORT,RAW,NAME('_rmdir'),PROC
END

!Procedure Embed
  IF XXAccess(DirVariableCstring)<>0
    XXMkDir(DirVariableCstring)
  END

Regards,
Johannes Boe


Quote:
>Hi Johannes,

>How about creating new directories using API other than using the RUN
>command, is it possible? Thank you.



>> Hi Gary,

>> You could use the api for Copy file (32bit)
>> Follow the info below:

>> !Global embed:     Inside the Global Map:

>>   MODULE('API')

>CopyFile(*CSTRING,*CSTRING,SHORT),SHORT,PROC,DLL,RAW,PASCAL,NAME('CopyFileA
'
>> )

>>   END

>> ! Procedure Embed:
>> SourceFile = 'T:\Company'
>> Destination = 'E:\CW20\APPS\Tow'     ! SourceFile and Destination =
>CSTRING
>> retcode=  CopyFile( SourceFile, Destination , 0 )

>> Regards,
>> Johannes Boe


>> >Using CW2003.  I need to copy a file from the network to the local drive
>> >from a CW program running on the local drive.  I have tried the code
>> >below and several variations but either I get compiler errors or it
>> >doesn't work because it doesn't know where Company is.  Company is on
>> >the network drive and I need to copy it to the local drive.  T: is the
>> >mapped network drive.

>> >COPY('T:\Company','E:\CW20\APPS\Tow')

>> >How do I do this?

>> >Gary



Wed, 06 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
Hi Johannes,

Thanks for your info. I appreciate it.

By the way, may I know how do can get a list of existing internal clarion
defined APi's? Thank you.:)


Quote:
> Hi Alvin,

> You could use the internal clarion defined APi's.
> The best way is to check that the directory do NOT exist and then create
it.

> !Global Embed:     Inside the Global Map:
> MODULE('')
>   XXAccess(*CSTRING,SHORT=0),SHORT,RAW,NAME('_access'),PROC
>   XXMkDir(*CSTRING),SHORT,RAW,NAME('_mkdir'),PROC
>   XXRename(*CSTRING,*CSTRING),SHORT,RAW,NAME('_rename'),PROC
>   XXRmDir(*CSTRING),SHORT,RAW,NAME('_rmdir'),PROC
> END

> !Procedure Embed
>   IF XXAccess(DirVariableCstring)<>0
>     XXMkDir(DirVariableCstring)
>   END

> Regards,
> Johannes Boe


> >Hi Johannes,

> >How about creating new directories using API other than using the RUN
> >command, is it possible? Thank you.



> >> Hi Gary,

> >> You could use the api for Copy file (32bit)
> >> Follow the info below:

> >> !Global embed:     Inside the Global Map:

> >>   MODULE('API')

>CopyFile(*CSTRING,*CSTRING,SHORT),SHORT,PROC,DLL,RAW,PASCAL,NAME('CopyFileA
> '
> >> )

> >>   END

> >> ! Procedure Embed:
> >> SourceFile = 'T:\Company'
> >> Destination = 'E:\CW20\APPS\Tow'     ! SourceFile and Destination =
> >CSTRING
> >> retcode=  CopyFile( SourceFile, Destination , 0 )

> >> Regards,
> >> Johannes Boe


> >> >Using CW2003.  I need to copy a file from the network to the local
drive
> >> >from a CW program running on the local drive.  I have tried the code
> >> >below and several variations but either I get compiler errors or it
> >> >doesn't work because it doesn't know where Company is.  Company is on
> >> >the network drive and I need to copy it to the local drive.  T: is the
> >> >mapped network drive.

> >> >COPY('T:\Company','E:\CW20\APPS\Tow')

> >> >How do I do this?

> >> >Gary



Fri, 08 Feb 2002 03:00:00 GMT  
 Copy file from network drive to local drive?
Hi,

I'd found it. It is in the Programmer Guide. Thanks anyway.


Quote:
> Hi Johannes,

> Thanks for your info. I appreciate it.

> By the way, may I know how do can get a list of existing internal clarion
> defined APi's? Thank you.:)



> > Hi Alvin,

> > You could use the internal clarion defined APi's.
> > The best way is to check that the directory do NOT exist and then create
> it.

> > !Global Embed:     Inside the Global Map:
> > MODULE('')
> >   XXAccess(*CSTRING,SHORT=0),SHORT,RAW,NAME('_access'),PROC
> >   XXMkDir(*CSTRING),SHORT,RAW,NAME('_mkdir'),PROC
> >   XXRename(*CSTRING,*CSTRING),SHORT,RAW,NAME('_rename'),PROC
> >   XXRmDir(*CSTRING),SHORT,RAW,NAME('_rmdir'),PROC
> > END

> > !Procedure Embed
> >   IF XXAccess(DirVariableCstring)<>0
> >     XXMkDir(DirVariableCstring)
> >   END

> > Regards,
> > Johannes Boe


> > >Hi Johannes,

> > >How about creating new directories using API other than using the RUN
> > >command, is it possible? Thank you.



> > >> Hi Gary,

> > >> You could use the api for Copy file (32bit)
> > >> Follow the info below:

> > >> !Global embed:     Inside the Global Map:

> > >>   MODULE('API')

>CopyFile(*CSTRING,*CSTRING,SHORT),SHORT,PROC,DLL,RAW,PASCAL,NAME('CopyFileA
> > '
> > >> )

> > >>   END

> > >> ! Procedure Embed:
> > >> SourceFile = 'T:\Company'
> > >> Destination = 'E:\CW20\APPS\Tow'     ! SourceFile and Destination =
> > >CSTRING
> > >> retcode=  CopyFile( SourceFile, Destination , 0 )

> > >> Regards,
> > >> Johannes Boe


> > >> >Using CW2003.  I need to copy a file from the network to the local
> drive
> > >> >from a CW program running on the local drive.  I have tried the code
> > >> >below and several variations but either I get compiler errors or it
> > >> >doesn't work because it doesn't know where Company is.  Company is
on
> > >> >the network drive and I need to copy it to the local drive.  T: is
the
> > >> >mapped network drive.

> > >> >COPY('T:\Company','E:\CW20\APPS\Tow')

> > >> >How do I do this?

> > >> >Gary



Fri, 08 Feb 2002 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Copy file from network drive?

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

3. WIN API to copy file from A: drive to C:\Folder

4. Copy files from floppy drives

5. Copying Files to another drive

6. Opening files on a network drive.

7. PHP files don't work in Windows network drive

8. Accessing a file in a network drive (python under win32)

9. Listing Valid Drives and Drive Types

10. I look for a vi which allows to drive a stepper motor drive

11. Can I use Keithley 2182 drive instead of Keithley 181 drive with slight variations

12. Determining Fixed Drives From Floppy Drives

 

 
Powered by phpBB® Forum Software