Copy Files and folders from one location to another [message #150367] |
Wed, 07 December 2005 10:20 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
olugbenga_oyeneye
Messages: 23 Registered: September 2005 Location: Lagos
|
Junior Member |
![goyeneye%40yahoo.com](/forum/theme/orafaq/images/yahoo.png)
|
|
I wrote the procedure below the displays a progress bar(Details below):
-------------------PROCEDURE SHOW_PROGRS--------
PROCEDURE SHOW_PROGRS( MIN_VALUE in Number, MAX_VALUE in Number) is
var1 varchar2(100);
BEGIN
FOR i in MIN_VALUE..MAX_VALUE loop
:PROGRESS_BAR:=null;
var1:= ROUND((i/max_value)*100);
:Position := var1||'%'; /* display item(:Position) displays the persentage of 'i'*/
var1 := RPAD(var1,var1,'|'); /* concat character '|' is the progress, here you can use '*' or any other suitable character */
--var1:=(substr(var1,4,100)||'|||'); /*this line is optional*/
:PROGRESS_BAR := (:PROGRESS_BAR||var1); /* display item(:PROGRESS_BAR) is the progress bar */
Synchronize;
:text_item26 := to_char(i); /* text item(:text_item26) displays the value of 'i' as it progresses */
end loop;
END;
------end PROCEDURE SHOW_PROGRS-----------------
--------when-botton-pressed-trigger-------------------
SHOW_PROGRS(1,1000); -- you can pass any value from 0..infinity
--------end when-botton-pressed-trigger-------------------
Now I want to copy files and Folders from location c:\ to location d:\ so that my progress bar will read the size of the source files and folder, copy the source files and folders to the destination drive or folder, calculate the progress using my progress bar also and dispay the progress bar.
I tried the code below but it did not work:
-----------------------begining-----------------------
PROCEDURE CopyFiles IS
v_source varchar2(3999):='c\:test.txt';
v_destination varchar2(3999):='D:\';
BEGIN
COPY (v_source,v_destination);
END;
---------------end-----------
I use Oracle9iDS.
I will appreciate your usual kind response.
Thank you.
-oyeneye_olugbenga
|
|
|
|
|
Re: Copy Files and folders from one location to another [message #150910 is a reply to message #150778] |
Sun, 11 December 2005 23:29 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Please search this forum for 'host' - there are many examples.
Quote: | I am looking for codes that will not be platform dependent though...
| Unfortunately as directory structures are platform dependent you will need to write code for each platform type, test for the type of platform on which you are working, and execute the appropriate code.
David
|
|
|