-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04316b4
commit e0ad686
Showing
1 changed file
with
10 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
import platform | ||
import reprlib # prevents barfing on weird characters in filenames | ||
import subprocess | ||
import shlex | ||
import sys | ||
import threading | ||
import time | ||
|
@@ -26,8 +27,8 @@ | |
#//****************************************************************************** | ||
|
||
PROGRAM_NAME = 'whereis' | ||
VERSION = '3.9.9' | ||
COPYRIGHT_MESSAGE = 'copyright (c) 2013 (1997), Rick Gutleber ([email protected])' | ||
VERSION = '3.9.10' | ||
COPYRIGHT_MESSAGE = 'copyright (c) 2014 (1997), Rick Gutleber ([email protected])' | ||
|
||
currentDir = '' | ||
currentDirCount = 0 | ||
|
@@ -212,6 +213,8 @@ def printRevisionHistory( ): | |
3.9.7: simple exception handling for Unicode filenames | ||
3.9.8: whereis detects Unicode filenames rather than throwing an exception | ||
3.9.9: added /g to turn off filename truncation | ||
3.9.10: changed from os.system( ) to subprocess.Popen( ) which doesn't | ||
block | ||
Known bugs: | ||
- As of 3.9.2, stdout from an executed command (/c) doesn't show up | ||
|
@@ -294,21 +297,21 @@ def outputDirTotalStats( absoluteFileName, fileSize, lineCount, attributeFlags ) | |
#// !! - single exclamation point | ||
#// !/ - OS-specific pathname separator | ||
#// !0 - '/dev/null' (or OS equivalent) | ||
#// !D - date (YYYYMMDD) when app was started | ||
#// !O - '>>' | ||
#// !P - absolute path | ||
#// !T - time of day (24-hour - HHMMSS) when app was started | ||
#// !b - base filename (no extension) | ||
#// !c - current working directory | ||
#// !d - date (YYMMDD) when app was started | ||
#// !D - date (YYYYMMDD) when app was started | ||
#// !f - fully qualified filespec | ||
#// !i - '<' | ||
#// !n - OS-specific line separator | ||
#// !o - '>' | ||
#// !O - '>>' | ||
#// !P - absolute path | ||
#// !p - relative path | ||
#// !q - double quote character (") | ||
#// !r - relative filespec | ||
#// !t - time of day (24-hour - HHMM) when app was started | ||
#// !T - time of day (24-hour - HHMMSS) when app was started | ||
#// !x - filename extension | ||
#// !| - '|', pipe character | ||
#// | ||
|
@@ -781,7 +784,7 @@ def main( ): | |
print( blankLine, end='\r', file=sys.stderr ) | ||
print( translatedCommand ) | ||
else: | ||
os.system( translatedCommand ) | ||
subprocess.Popen( shlex.split( translatedCommand ), shell=True ) | ||
|
||
lineCount = 0 | ||
|
||
|