473,549 Members | 2,723 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

develop automated folder structure

16 New Member
I want to desing a automated folder structure script, when given the name of the root folder, the children folders along with the root folder are created automatically.

The folder structure should be like this:

ParentFolder
--> 1. Child1 ==> GrandChild1, GrandChild2, GrandChild3
--> 2. Child2
--> 3. Child3

Only the name of the ParentFolder will be given by the user and other folders name will be hard coded.

How can I do it?

Please can any one help me, do any one have any snippets for this?
Mar 18 '14 #1
1 1533
bvdet
2,851 Recognized Expert Moderator Specialist
The os module provides all the functionality to do what you want. os.makedirs(fil e_path) will recursively create nested directories. os.path.join(pa th1 [,path2 [, ...]]) will intelligently joint one or more path components into a complete path name.
Mar 18 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5793
by: ragha | last post by:
Dear friends I am emulating thr tree structure mentioned in the article http://www.15seconds.com/issue/010921.htm I have succesfully created the folder structure for level 2 I need this structure till 5 level is there any easier way to generate this using xsl My xml tree node is
0
1303
by: David Waddell | last post by:
Hi, I'm trying to setup a project folder structure in vs.net 2003 as follows : <project root> src doc test bin The only glitch I'm hitting is that the "New Class" wizard will append ".src" as part of the namespace to classes I add is src. Is there any way to
0
1070
by: riversmithco | last post by:
Hi all, I am pulling my hair out on this one. I am following the Microsoft guidelines on how to structure folders and check in ASP.Net apps to VSS. Here's the problem: 1. I create a blank project called MyWebSolution so a folder is created for me.
9
8312
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3) and two folders (Subfolder 1, Subfolder 2). .......I need to delete File1, File2, File3. Subfolder 1 contains FileA. .......Need to delete FileA....
0
945
by: andoband | last post by:
Using VS 2005, I have created a solution and it's projects using the following physical folder structure: d:\projects\Enterprise.root\Enterprise\Enterprise.sln d:\projects\Enterprise.root\Enterprise\Libraries\Core\Enterprise.Core.csproj d:\projects\Enterprise.root\Enterprise\Web Sites\Portal\ d:\projects\Enterprise.root\Enterprise\Web...
4
4073
by: Sergei Minayev | last post by:
Hi All! Can you please help me with the following problem: I need to store a copy of local folders structure in MySQL database. I have chosen the following table structure for that: ------------------------------------------------ | id | id_uplink | folder_name | ------------------------------------------------ id - unique property of...
1
3583
by: rkoduru | last post by:
Hi All, I am looking for a script which will parse the folder structure (recursive) of a drive using my windows credentials (2003 domain) and give me the list of any folders/files that i dont have access to. Any quick help is greatly appreciated. Ratan
0
1442
by: HarXon | last post by:
Hi, I am relatively new to C# and am attempting to implement the following: I currently have a text file containing the full path of all folders on a disk, from this i would like to create a Tree view, and make it look as similar to a folder structure(View like Windows Explorer) as possible. Does anyone have a clue where to start!? I...
5
2621
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application. In a nutshell, I understand how this can be considered desireable by some, but I am not one of those people. My situation is that we have a...
0
2349
by: Chuck Anderson | last post by:
I'm trying to come with a good organization plan for the Apache, Php, MySQL development software on my home PC and am wondering what sort of folder structure others may have come up with that seems handy, easy to backup, and modularized. My setup has not changed much over the years. As of now I have: C:\apache2.2 C:\mysql C:\Php
0
7520
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...
0
7450
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7957
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
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...
0
7809
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...
0
5088
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3500
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...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
763
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.