473,669 Members | 2,452 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dir_util.copy_t ree call

Hi all.
I am using IDLE when I am on the python shell, I do:
import os
os.mkdir('ne wdir')
from dirutils import dir_util
#copy a big directory tree
dir_util.cop y_tree('big_dir ectory','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\Auto mateBuild\pyBui ldAutomate.py", line 19, in ?
dir_util.copy_t ree('Py4CliLinu x','CliAuto-lin')
File "C:\Python24\Li b\distutils\dir _util.py", line 172, in copy_tree
dry_run=dry_run ))
File "C:\Python24\Li b\distutils\dir _util.py", line 175, in copy_tree
preserve_times, update, dry_run=dry_run )
File "C:\Python24\Li b\distutils\fil e_util.py", line 165, in copy_file
_copy_file_cont ents(src, dst)
File "C:\Python24\Li b\distutils\fil e_util.py", line 47, in
_copy_file_cont ents
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 3627
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
5173
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
10772
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
13
4125
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 sense to punch out from managed code to native code (I was using IJW) in order to do some amount of floating point work and, if so, what that certain amount of floating point work was approximately. To attempt to do this I made a program that...
4
4279
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 I know I need to call a function that will save data but I'm not sure exactly when to call this function. I've tried two ways and both seem to have 'gotcha's':
5
3774
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 as to what this means? I am not trying to alter a table. This particular CL merely generates the next voucher number in a sequence. "SQL0204: HRCU030P in HRZNCUSOBJ type *N not found. Cause . . . . . : HRCU030P in HRZNCUSOBJ type *N was...
13
26591
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
6800
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 period of time. I want something like thread.abort for aborting aynchronous call. Can someone tell me way of aborting asynchronous call.
13
9707
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 initialized properly as constructor same is not get called ( as per the behavior). How to call a constructor explicitly if we want to allocate memory using malloc ?
3
4778
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 results into another DB? I know from Wscripts and MS-Sql that you can build just two objects but I did not see something like that in REXX. Thanks in advance for your help
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8895
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8588
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4206
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.