Helpful 5-liner version of os.makedirs

Category: Python - Miscellaneous

This script contains a function that creates missing directories for a given path and returns a normalized absolute version of the path.If the given path already exists in the filesystem the filesystem is not modified.Otherwise makepath creates directories along the given path using the dirname() of the path. You may append a '/' to the path if you want it to be a directory path. The usual os.makedirs functions and friends are not convenient enough. They don't return the path and they always throw errors if the directories already exist. Many times you just want to make sure that the directories of a path are really there without the fuss. And you want your directories to be os-independent (e.G. slash versus backslash issues).  makepath does all this.if one of the directory parts of the path already exists and is e.G. a regular file the usual os.makedirs exceptions will be thrown which is ok because your path cannot be constructed. Date: 19 March, 2012


Directory Path - Normalized Path - Path Generator - Directory - Path - Generator

Homepage: http://code.activestate.com

Developer: code.activestate.com

License: Artistic License, GNU General Public License (GPL)

Operating System: Windows, Linux, Mac OS, BSD, Solaris

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

This script is a generator that does what os.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Gruve's FREE Link Directory Manager component allows webmasters to easy add a full featured Link Directory manager to their web site.

developer Developer: Paul Christenbury
license License: Freeware
operating systems Operating System: Windows


Yet another link directory (YALD) is a simple yet powerful and efficient link directory/index program written in PHP with a MySQL backend.

developer Developer: newbie455
license License: GNU General Public License (GPL)
operating systems Operating System: All 32-bit MS Windows (95/98/NT/2000/XP), All POSIX (Linux/BSD/UNIX-like OSes)


qlWebDS Web Directory Script offers unique tools and features.

developer Developer: Art Capri
license License: GNU General Public License (GPL)
operating systems Operating System: linux, windows, freebsd, osx, sun


Create a general directory of the best resources accross the web, and allow people to submit their sites.

developer Developer: NetCreated
license License: GNU General Public License (GPL)
operating systems Operating System: Unix, Win


Link bid script is a free bid for position directory software.

developer Developer: Biodun
license License: GNU General Public License (GPL)
operating systems Operating System: Not Available


BPDirectory is a directory site script made for US and Canada businesses.

developer Developer: BPowerhouse
license License: GNU General Public License (GPL)
operating systems Operating System: widows


This script allows you to extract file version information from Windows ;nbsp;to ing the Win32 API.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows


This script will swap extensions on all files in the specified directory, and all of its subdirectories, and all of their subdirectories, etc.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows, Linux, Mac OS, BSD, Solaris