473,765 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Temp File Cleanup for McMillan Installer Pgms

After using the McMillan installer and executables built with
it for a while, I've noticed some residual files accumulating
on my disk. The installer docs mentions these.

Here's code I wrote to clean these up:

--------------------Program Fillows----------------------

import fnmatch
import os
import os.path
import stat
import tempfile
import time

currentTime = time.time()

def PathIsOld(pathN ame):
accessTime = os.stat(pathNam e)[stat.ST_ATIME]
createTime = os.stat(pathNam e)[stat.ST_CTIME]
modifiedTime = os.stat(pathNam e)[stat.ST_MTIME]
return (((currentTime - accessTime) > 5000) or (
(currentTime - createTime) > 50000)) and (
(currentTime - modifiedTime) > 5000)
def GetMEISubdirect ories(aDir):
for fName in os.listdir(aDir ):
if fnmatch.fnmatch (fName, "*"):
if fName.lower()[:4] == '_mei':
fullName = os.path.join(aD ir, fName)
fMode = os.stat(fullNam e)[stat.ST_MODE]
if stat.S_ISDIR(fM ode):
yield fullName

def GetMEIFiles(aDi r):
for fName in os.listdir(aDir ):
if fName.lower()[:4] == '_mei':
fullName = os.path.join(aD ir, fName)
fMode = os.stat(fullNam e)[stat.ST_MODE]
if stat.S_ISREG(fM ode):
yield fullName
def GetTempLocation ():
return tempfile.gettem pdir()

def GetMEIDirectori es():
return filter(
PathIsOld,
GetMEISubdirect ories(GetTempLo cation())
)

def DeleteMEIDirect ory(d):
for fileName in os.listdir(d):
fullName = os.path.join(d, fileName)
try:
os.remove(fullN ame)
except:
pass
try:
os.rmdir(d)
except:
pass

for d in GetMEIDirectori es():
DeleteMEIDirect ory(d)

for f in GetMEIFiles(Get TempLocation()) :
if PathIsOld(f):
os.remove(f)

-----------------------End of Program -------------------------

What are the top 10 reasons for not including this in every
program that I turn into an executable with the McMillan
installer?

TIA

Al
Jul 18 '05 #1
0 1503

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

Similar topics

6
3948
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with Python 2.3) - PIL 1.1.4 - Installer or py2exe : latest versions.
0
1017
by: simo | last post by:
Been trying http://www.mcmillan-inc.com for a few days now and keep getting 404 and directory listing denied etc. errors. Luckily I've already downloaded Installer and it's great - better than py2exe for my uses, especially when combined with UPX. Has anyone had any luck with getting the Windows version running under Wine, so I don't have to reboot to Windows from Linux to create a Windows .exe - it doesn't seem to support...
1
1546
by: bap | last post by:
Is anyone else having problems accessing the Mcmillan installer web site (www.mcmillan-inc.com)? I get a no permission error message - so I don't know if my ISP is blocked or something is wrong with the web site. Bruce Peterson
2
2907
by: Federico | last post by:
Hi, Where can I download the mcmillan installer utility? http://www.mcmillan-inc.com/ doesn't exist anymore? Thanks
9
1982
by: Christopher Stone | last post by:
I can't seem to find a working web site for this installer. Are there any mirror sites available which have this application? I need an installer for Linux based systems, and I heard this was the best. Thanks in advance! -Chris
1
1986
by: Chris | last post by:
I would like to be able to "package-up" a Python application on my development platform (Linux) so that it can be easily distributed and installed on Windows and UNIX e.g. HP-UX, AIX etc. I'd rather not use Python's disutils. I've looked at cx_Freeze but this requires a "base executable" to be available for each target platform i.e. I'd need to compile this base executable on the target platforms but I don't have access to them all. I've...
4
2105
by: mrmakent | last post by:
3 quick questions for the newsgroup: 1. Does anyone know why McMillan Installer 5b5 does not work with Python 2.4 under Linux (works with Python 2.3 just fine), and how to fix it? 2. Will anyone be picking up the maintenance and development ball for McMillan Installer? 3. Is there another, better-supported solution for distributing a
13
4281
by: Kevin Walzer | last post by:
Which of the Windows/Unix package builders for Python applications is capable of creating single-file executables? I'm thinking of: 1. py2exe 2. Mcmillan Installer/PyInstaller 3. cxfreeze The apps I've seen created by py2exe aren't single-file at all, the install folder is full of files besides the main program. I'm looking for a solution that stuffs all libraries, scripts, and the Python
0
834
by: mrstephengross | last post by:
I'm trying to get the mcmillan installer utility to generate a standalone executable for me. I've gotten to work--almost!--but still have one problem. After running Installer's Build.py on my script/spec, it appears to work. I go into the directory generating by Build.py and run my program. It works! Then I copy my program (foo) to a different directory and try to run it there. It complains that: "Cannot open self /home/sgross/foo or...
0
9568
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
9398
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10156
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...
0
10007
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8831
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
6649
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
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...
1
3924
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
3
2805
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.