473,509 Members | 12,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dir_util.copy_tree call

Hi all.
I am using IDLE when I am on the python shell, I do:
import os
os.mkdir('newdir')
from dirutils import dir_util
#copy a big directory tree
dir_util.copy_tree('big_directory','newdir')


This works properly, but I find a huge Resource Comsumption of my PC.
100% of CPU and Memory.

Now, when I put the same steps a python file and then Run Module:

copy_tree is failing with

Traceback (most recent call last):
File "C:\builds\AutomateBuild\pyBuildAutomate.py", line 19, in ?
dir_util.copy_tree('Py4CliLinux','CliAuto-lin')
File "C:\Python24\Lib\distutils\dir_util.py", line 172, in copy_tree
dry_run=dry_run))
File "C:\Python24\Lib\distutils\dir_util.py", line 175, in copy_tree
preserve_times, update, dry_run=dry_run)
File "C:\Python24\Lib\distutils\file_util.py", line 165, in copy_file
_copy_file_contents(src, dst)
File "C:\Python24\Lib\distutils\file_util.py", line 47, in
_copy_file_contents
fdst = open(dst, 'wb')
IOError: [Errno 2] No such file or directory: 'big_directory/some/path'
# modified the actual names.

- What I am doing is trying to copy a directory tree to a another
directory tree.
- shutil.copytree does not help as it requires the dst directory to be
absent.

Any help?

Thanks!
Senthil
--
http://puggy.symonds.net/~senthil

Mar 28 '06 #1
1 3617
In IDLE, by default the working directory for the interactive prompt is
the working directory for IDLE itself. The working directory for
running a module is the directory the module is stored in. In your
script, use absolute paths or set the

--
Want to play tabletop RPGs over the internet?
Check out Koboldsoft RPZen: http://www.koboldsoft.comcwd.

Mar 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
5140
by: Fabian Müller | last post by:
Hi all, my question is as follows: If have a class X and a class Y derived from X. Constructor of X is X(param1, param2) . Constructor of Y is Y(param1, ..., param4) .
35
10740
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
13
4099
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
4
4272
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
5
3763
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue...
13
26574
by: mitchellpal | last post by:
i am really having a hard time trying to differentiate the two..........i mean.....anyone got a better idea how each occurs?
7
6795
by: archana | last post by:
Hi all, I am having application in which i am doing asynchronous call.I am using manualresetevent to wait for asynchronous call to complete. I want to stop asynchronous call after certain...
13
9673
by: shsingh | last post by:
I have a class A containing some map as data variables. I creat an object of class A on heap by allocatiing memory by using "malloc". This will return me the required memory but the object is not...
3
4765
by: cberthu | last post by:
Hi all, Is it possible to have two connects in the same rexx script to different DB's? I have to get data form on DB (with specifics selects and filter out some values with RExx) and save the...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.