Copying files, changing attributes (CW20) 
Author Message
 Copying files, changing attributes (CW20)

The sample program from John (SilverGhost) works great in 32-bit. I tried
changing the program to 16-bit but I get this message:

SETFILEATTRIBUTES is unresolved in file copyfile.obj
COPYFILE is unresolved in file copyfile.obj

where copyfile.obj is the name of the executable.

I tried reading the Programer's Guide API and  inserted the lines:
INCLUDE('WINAPI.CLW','EQUATES')
INCLUDE('WINAPI.CLW','PROTOTYPES')
INCLUDE('CLIB.CLW')

I also tried getting information from msdn.microsoft.com on copyfile 16-bit but
did not find any.

As you can tell I don't know much about calling APIs but it seems that I need
the name of the DLL or OBJ file that contains the CopyFile and
SetfileAttributes functions and link it. I would like to use these functions in
16-bit and learn more about other available API functions.

Any additional help/pointers is greatly appreciated.

Quote:
>Hi Jvarela,
>This clw file will show the functions in 32 bit only
>If you want to use it in 16 bit, remove the A from
>CopyFileA &? SetFileAttributesA
>Hope this helps
>John
>?
>?

>PROGRAM

>?? INCLUDE('Equates.CLW')
>?? INCLUDE('TplEqu.CLW')
>?? INCLUDE('Keycodes.CLW')
>?? INCLUDE('Errors.CLW')
>FILE_ATTRIBUTE_READONLY?? EQUATE(1)
>?? MAP
>???? MODULE('')
>???????? CopyFileA(*CSTRING,*CSTRING,BOOL),BOOL,Pascal,RAW
>???????? SetFileAttributesA(*CSTRING,ULONG),BOOL,PASCAL,RAW
>???? END
>?? END
>FROMFILE?? CSTRING(128)
>TOFILE???? CSTRING(128)
>Window WINDOW('Testfiles'),AT(,,185,92),FONT('MS Sans
>Serif',8,,FONT:regular),CENTER,GRAY
>??????
>BUTTON('Close'),AT(132,68,44,14),USE(?close),FONT('Arial',12,,FONT:bold,C

HARSET:ANSI),STD(STD:Close)

- Show quoted text -

Quote:
>???? END
>?? CODE
>?? FROMFILE ='C:\AUTOEXEC.BAT'
>?? TOFILE ='F:\AUTOEXEC.BAK'
>?? OPEN(WINDOW)
>?? ACCEPT
>?? END
>?? IF NOT COPYFILEA(FROMFILE,TOFILE,0) ;END
>?? IF NOT SetFileAttributesA(TOFILE,FILE_ATTRIBUTE_READONLY) ;END
>?
>?

>John
>?
>?
>?


>> I would like to know how to copy files and change file attributes without
>using
>> the RUN command. I recently got a reply telling me that there was an API
>that I
>> could use but I have not been able to get more information on it. Do I need
>to
>> buy additional software to be able to use APIs? Is there information that
>lists
>> the functions available on APIs or how to use them?
>> Any help is appreciated.



Tue, 04 Jun 2002 03:00:00 GMT  
 Copying files, changing attributes (CW20)


Quote:
> SETFILEATTRIBUTES is unresolved in file copyfile.obj
> COPYFILE is unresolved in file copyfile.obj

these api's are 32 bit only - not found in 16 bit. In 16 bit there is a
c language runtime function called _chmod that can set some attributes.
For copy file you need to write your own based on _lopen, _lRead,
_lwrite, _lclose and a little loop.
----------
Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com


Tue, 04 Jun 2002 03:00:00 GMT  
 Copying files, changing attributes (CW20)
Thank you Jim. I'll try the chmod.


Fri, 07 Jun 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Copying files, changing attributes (CW20)

2. Copying files / changing attributes (CW20)

3. Copying files and changing attributes (cw20)

4. CW2.003 File copy changes the date.....need a way to copy w/o date change

5. Setting file attributes and Copying files

6. CW2.003 Copy file changes file date

7. Changing file attributes at runtime

8. C4 ABC - Change of file attribute

9. CW20 List Boxes w/ Mark Attribute

10. Change File Attributes

11. CW20: Printing Mutiple Copies of a Report

12. Copy file without date change.

 

 
Powered by phpBB® Forum Software