Copying and Pasting Directories and Files

License: Freeware
Date Added: 07 February, 2013
Category: Scripts / File Manipulation
Author: activestate.com

This script presents a few basic fuctions that allow someone to copy a directory (along with its files and sub-directories) and paste it somewhere else. They ignore links and anything else that is not a directory or a file.


Advertisements



 

This script presents a few basic fuctions that allow someone to copy a directory (along with its files and sub-directories) and paste it somewhere else. They ignore links and anything else that is not a directory or a file. The data returned from copy_dir() is in a format that paste_dir() can understand. A design note: what you get back from copy_dir() may be different whether or not you have a path separator at the end of the path; paste_dir() makes use of that feature (whether or not you want the first folder to be created). The functions can easily be modified to not include sub-directories in the returned package, and errors caused by accessing to files or directories can also be ignored with some simple editting. Also, note the asserts in the functions; these functions are designed to crash hard so that the calling code has to take care of the errors.


Operating Systems:  Python, Windows, Linux, BSD, Solaris, Mac OS


Copying and Pasting Directories and Files Related Downloads
 
Download TyphoonCopy 2.0000

TyphoonCopy 2.0000  Start copying smarter! TyphoonCopy provides an interface that gives you more control over file copy than ever before. Features include copy previews, replicated folder structure, and the ability to copy only files that have changed.

Download Magican File 1.2.0

Magican File 1.2.0  Magican File is updated to help Mac users to find files more quickly. It can copy, cut, paste, delete, compress, creat files and folders, still features of searching files, looking file property and opening terminal are also available.

Download FSList 1.0

FSList 1.0  This script allows you to manage a list of files, directories and other  file system objects. Optionally recurses directories and ensure that each item in the list is a regular file.

Download Flexible directory walking 1.1

Flexible directory walking 1.1  This function walks a directory tree starting at a specified root folder, and returns a list of all of the files (and optionally folders) that match our pattern(s).The standard match our tree function os.path.

Download Extracting Windows file versions 1.6

Extracting Windows file versions 1.6  This is my attempt at extracting the file version information from .dll, .exe, .ocx files etc. on Windows 2000 (should work with others, but I haven't tested it), without resorting to using extensions (i.e. dll functions).

Download Slither 1.0

Slither 1.0  This script searches your hard drive for all files specified and generates an HTML web page list of the files found and links to the file itself. This search is fast and very little code to complete the task.

Download Parsing binary files with regular expressions 1.0

Parsing binary files with regular expressions 1.0  This script allows you to use the regular expression engine to parse binary files, especially those for which the struct module alone is inadequate.The typical way to parse binary data in Python is to use the unpack method of the struct module.

Download Zip and Pickle 1.0

Zip and Pickle 1.0  This module saves and reloads compressed representations of generic Python objects to and from the disk.

Download Clean up a directory tree 1.0

Clean up a directory tree 1.0  This script can be used to clean up a directory tree irrespective of whether the directory tree contains non-empty directories. As long as the user has permission to remove the files, this will work.

File Manipulation Popular Downloads
 
Download Free File Splitter Joiner 5.5.5

Free File Splitter Joiner 5.5.5  Free file splitter joiner software to split any file into smaller pieces for easier transfer, storage and file management, and then rejoin them later for use.

Download Parsing a full file specification 1.1

Parsing a full file specification 1.1  This function parses a full file specification into tuple of: a) list of drive and folders b) file name c) (last) file extension (including dot)A full file specification consists of drive letter, folders, file name, and extension.

Download php Download Manager 1.1

php Download Manager 1.1  php Download Manager is a script package written in php with a MySQL back-end. The script allows site owners to offer downloads by category. The program generates code to link to categories or individual downloads.

Download basE91 0.6.0

basE91 0.6.0  basE91 is an advanced method for encoding binary data as ASCII characters. It is similar to UUencode or base64, but is more efficient.The overhead produced by basE91 depends on the input data.

Download aria2 0.11.4

aria2 0.11.4  aria2 is a download utility with resuming and segmented downloading. Supported protocols are HTTP/HTTPS/FTP/BitTorrent. It also supports Metalink version 3.0. As of 0.10.

Download Progress bar class 1.0

Progress bar class 1.0  Here is a little class that lets you present percent complete information in the form of a progress bar using the '#' character to represent completed portions, space to represent incomplete portions, and the actual percent done (rounded to integer)

Download MyDMS 1.7.0

MyDMS 1.7.0  MyDMS is an open-source, web-based document management system written in PHP and supported by an SQL database. Originally coded by Markus Westphal, MyDMS provides document meta-data, version control, security and easy access to your documents.

Download PKZip library for PHP 0.4.1

PKZip library for PHP 0.4.1  PKZip library for PHP contains a set of functions to create PKZip (Winzip) files in PHP.

Download PKTorrents 0.1b 1.0

PKTorrents 0.1b 1.0  PKTorrents has the functionality to crawl the top torrent sites, Meganova, Mininova, Piratebay, Snarf, Torrentportal, Torrentspy and adding 1000's of torrents to the db as it gos using the well know ibitzy torrent spider/crawler!!

Submit Reviews for Copying and Pasting Directories and Files
- required fields