Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Command

Status
Not open for further replies.

newtoclarion

Programmer
Jul 20, 2011
66
SA
Dear All
I have this application which has a part where I have to copy large files (GBs).
the problem is while copying , when I start anything the screen goes blank. of course because the copying is in progress but the user thinks that it is hanged up.
so is there a way to show the progress of the file copying (not necesserly the copy command, and way to copy large files from clarion)

Iam using clarion 6.3

Best Regards


 
If using the Clarion COPY command you can place a PROGRESS control in your app to indicate progress to the user (see PROGRESS in the help). If you are exiting to DOS to Copy (ie. a batch file) then you might consider looking into using the Clarion COPY command within you app instead?

 
Thank you TinLegs for your reply.
Iam using clarion copy command but I dont know how to apply the progress bar with the copy command as it has only two parameters : COPY(file,new file) and cant put any order while the copy in process (as far as I know).

I will be so thankful if you give an idea how to apply the progress bar while copying.

Best regards

 
Not to sure if its the best way but it works for me...

1. Place a 'Progress control' on the window (Use var defaults to 'Progress1'.
2. When the button on the window is pressed that initiates the COPY command I have the following code at the buttons 'Accepted' embed point. In my case I am backing up *.tps files to a user selected drive.

The 'FullDirectoryName' is the backup Path
ie. first confirm Path is OK, something like...
FullDirectoryName = CLIP(LOC:DriveLetter) &':\FolderName'
IF EXISTS(FullDirectoryName) !Path is OK - continue
ELSE
X# = MkDir(FullDirectoryName) !Create the directory (MkDir defined in the Global Embeds)
END

You will need this in the Global Embeds at the 'Inside the Global Map' to create user defined folders
MODULE('WINAPI')
!added so can create MyDirectoryName
MkDir(*CSTRING),SHORT,RAW,NAME('_mkdir')
END

Then the code for the button that initiates the COPY command...

LOC:FileName = 'File1.tps'
IF EXISTS(LOC:FileName)
COPY(LOC:FileName,FullDirectoryName)
IF ERRORCODE()
DO BackupError !Error Message
CYCLE
END
END
Progress1 = 30 !Use Var in Progress control + ie. 30% full
DISPLAY()

LOC:FileName = 'File2.tps'
IF EXISTS(LOC:FileName)
COPY(LOC:FileName,FullDirectoryName)
IF ERRORCODE()
DO BackupError
CYCLE
END
END
Progress1 = 65 !Use Var in Progress control + 65% full
DISPLAY()

LOC:FileName = 'File3.tps'
IF EXISTS(LOC:FileName)
COPY(LOC:FileName,FullDirectoryName)
IF ERRORCODE()
DO BackupError
CYCLE
END
END
Progress1 = 100 !Use Var in Progress control + 100% full
DISPLAY()
 
Hi TinLegs,

thank you for the reply, but my problem is that I am copying a big file (more than 7GB). the thing that it takes time to copy through the network (approx. 7 minutes). what I want is to have some changeable effect to tell the user that the copy is still running. Now I am putting a "wait" prompt until it is done but it is not enough because if user opens any other window and goes back to my screen it will be blank until the copy process finishes.

If you have any ideas we can share I'll be thankful.

Best Regards
 
gettig the size is easy by using GetFileSize function (if that is the question). but still it does not solve my problem that no action can be performed while the copy is in progress. Further more, the copy command create a dump file with the same size as original from the beginig of the copy process. so no use of knowing the destination file size.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top