Help Copy Files 
Author Message
 Help Copy Files

Why Wont This Copy Files Correctly
Say A (41.1 K) file is copied as A (17.0 K) File
What's Up With That!
This Code Looks Sound Any Help
note: Small files Like Txt, And Ini File copy OK
          But Larger Exe's Like The Size Above Don't

USERDATA$ = "C:\TEST1\"
BACKDATA$ = "C:\TEST2\"
NFILE$ = DIR$(USERDATA$,ZZ)
WHILE Len(NFILE$) > 0
source$ = USERDATA$ + NFILE$
dest$ = BACKDATA$ + NFILE$
CLOSE
OPEN source$ FOR BINARY AS #1
OPEN dest$ FOR BINARY AS #2
msg$ = SPACE$(LOF(1)) 'set msg$ string length to file length
GET #1, , msg$
LOCATE 14,25:COLOR 14, 9:PRINT "                                 "
LOCATE 14,27:COLOR 14, 9:PRINT USERDATA$;NFILE$
DELAY 0.3
PUT #2, , msg$
CLOSE 'both #1 and #2
NFILE$ = DIR$
WEND



Sat, 29 Nov 2003 12:14:23 GMT  
 Help Copy Files
In any version of PB/DOS individual strings are limited to 32767 bytes.
However, you should have gotten an "overflow" error when attempting to
assign a string of size 41000. (You have a further limitation of total
string space depending on version).

Did you maybe not show show us an ON ERROR RESUME NEXT statement in effect?
or all you running with $ERROR ALL OFF ???

--
Michael Mattias
Tal Systems
Racine WI USA


Quote:
> Why Wont This Copy Files Correctly
> Say A (41.1 K) file is copied as A (17.0 K) File
> What's Up With That!
> This Code Looks Sound Any Help
> note: Small files Like Txt, And Ini File copy OK
>           But Larger Exe's Like The Size Above Don't

> USERDATA$ = "C:\TEST1\"
> BACKDATA$ = "C:\TEST2\"
> NFILE$ = DIR$(USERDATA$,ZZ)
> WHILE Len(NFILE$) > 0
> source$ = USERDATA$ + NFILE$
> dest$ = BACKDATA$ + NFILE$
> CLOSE
> OPEN source$ FOR BINARY AS #1
> OPEN dest$ FOR BINARY AS #2
> msg$ = SPACE$(LOF(1)) 'set msg$ string length to file length
> GET #1, , msg$
> LOCATE 14,25:COLOR 14, 9:PRINT "                                 "
> LOCATE 14,27:COLOR 14, 9:PRINT USERDATA$;NFILE$
> DELAY 0.3
> PUT #2, , msg$
> CLOSE 'both #1 and #2
> NFILE$ = DIR$
> WEND



Sat, 29 Nov 2003 19:45:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help copy file

2. Please Help: Copying files using GS-VW

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

4. BUG: file copy copies links as links

5. Help File Copy

6. Help With File Copy

7. Need help copying a file to the printer

8. Help on copy file

9. Help, need to copy a 1474560 (1.404M) byte file to floppy disk

10. Need help - expect script: Copy a file from tftp server to cisco router flash

11. HELP: how to copy binary files?

12. searching and copying text in a file - please help

 

 
Powered by phpBB® Forum Software