Feature request: Add date and time to filename of encrypted file

Henry Hertz Hobbit hhhobbit at securemecca.net
Thu May 26 08:12:32 CEST 2005


On Tue, 2005-05-24 at 21:07 +0930, Roscoe wrote:
> Hmmm, out of curiosity did you intend to send that to the list?

Nope.  And although I am sending this one to the list, it is for
PRIVATE distribution and discussion only.  I don't think it is of
general interest.  Then again, I could be wrong...it has happened
lots of times before now.

> I probably should use 4 digits for the year, no point in perpetuating
> y2k-like bugs.
> The reasoning behind putting the year first, then the month, then the
> day is that its in order of significance. If a list of files named
> according to $STR.%Y%m%d is put in alphabetical order, then obviously
> they'll also be in chronological order, which is somewhat handy at
> times :).

I agree.  You may be better off with underscores between the year,
month, and day, with the month being numerical.  That makes it handy
to feed into sort.  Then again, I have had so many problems with the
REGEXP in sort I have written my own sort utility.  Basically, my
ssort uses a highly modified heap sort that does no REGEXP at all.
Yes, it runs faster than the generic qsort() function.  That is why
I wrote it.  I write C code faster than I can write shell (sh)
scripts.

> While I'm not honestly sure what intentions the gnupg team have for
> gnupg, I've always thought it was very much a *nix type app.
> >From the FAQ:

They have now finally totally automated the install of GnuPG on
Windows, including writing in the proper registry settings.  In
other words, they are NOT ignoring Window's presence, and GnuPG
integrates very well with Enigmail / Thunderbird, including the
automatic importation of keys on Windows.  In fact the whole
installation is pretty much point and click now.  I do not
consider that to be indicative that the GnuPG camp is ignoring
the Microsoft Windows platform.  I do wish they would NOT auto
generate the keys at install time, since I import mine from the
Linux platform (JUST COPY THEM INTO PLACE).

> "1.1) What is GnuPG?
> 
> GnuPG stands for GNU Privacy Guard and is GNU's tool for secure
> communication and data storage...."
> 
> "1.3) Is GnuPG free to use for personal or commercial use?
> 
> Yes. GnuPG is part of the GNU family of tools and applications built
> and provided in accordance with the Free Software Foundation (FSF)
> General Public License (GPL)..."
> 
> By reading that it kind of feels as if the purpose of gnupg is to
> serve as a tool in the GNU OS (using your choice of kernel which at
> present appears to only be kFreeBSD and Linux. Hurd's usable [just,
> and not for much], though gnupg won't run [out of the box, at least]).
> So while Windows is has most of the desktop market share, I typically
> answer questions regarding gnupg under the assumption that the user is
> using gnupg in a GNU or close to userland.
> As far as feature additions go, my opinion of them is that if theres a
> feature lacking, then it should be implemented. In this case theres
> not, as date and the shell provide such functionality [which are part
> of any functioning GNU userland].
> 
> (That said, I'm sure theres a Windows equivalent of a similar command
> that has the some outcome though knowledge of how to use Windows is
> beyond me, I've asked those immediately near me that use that OS as to
> what a possible solution is but no ones answered :(, yet?)

<SNIP>

There isn't a 'Nix DATE equivalent on Windows (something that
you would use inside a Windows Shell Script) unless you install
CygWin, MKS, or similar Unix utilities.  With CygWin you get bash
and the whole enchilada.  The TIME and DATE commands provided by
Microsoft do NO formatting.  If you type them without an argument,
they will prompt you for the argument which is either the date or
the time respectively you want to reset the machine to.  If you
intend to use them and assign them to a variable in Windows Shell
Scripting, it gets really messy.  Trust me on this one - I have
been there and I am not going that way again!  You have to create
a file with an empty line to redirect into the date or time
command to get rid of the nasty query for the set parameter!

Windows Shell Scripting is nothing more than batch, updated badly.
For the life of me, I don't understand how they could do things so
badly.  No wonder David Korn roasted them.  That leaves us with
Windows Script Host, with Microsoft providing JScript (derived
from JavaScript but meant for local, not network use) and VBScript
(derived from Visual Basic).  The DATE object is available in
JScript, but I can find no reference to it in VBScript. I would
like to say it is there, but I don't know whether it is or not.
Every time you execute a JScript or VBScript script (actually
a Windows Script Host script which can mix not only JScript and
VBScript but ActivePython, PerlScript, and Object REXX all in the
same script - well, sort of) in cmd.exe and want to force the run
time execution environment you have to type either:

	REM To execute inside the cmd window itself
	cscript NAME_OF_SCRIPT
	REM - or - to execute in a GUI
	wscript NAME_OF_SCRIPT

wscript is the default (the default can easily be changed to
cscript, then back to wscript if desired).  If you just double
click on the script, you get the default.  cscript runs in a
cmd.exe (Command Prompt), whereas wscript is a GUI kind of
like TK/TCL (GTK).  The problem is, it just isn't as simple to
do the date on Windows as it is with the 'Nix date command in
a shell script.  YOU HAVE TO WRITE A WHOLE STINKING SCRIPT JUST
TO DO THE DATE!  Also, there is no such thing as a backquote.
Yep, you have to write the stuff into a file, or go through
a lot of messy crap just to get the string that you want!
Complicating matters even further, I still don't know how to
access the environment variables in either JScript or VBScript.
I am sure you MUST be able to do it. In other words, I am in a
learning process on all of this right now.  It took me MONTHS
to write the gvimc.bat command to delete my _viminfo file, no
matter who I am logged in as. I usually do NOT want to go back
exactly to where ever I was in a given file when I edit it
again.  I also don't want it remembering my searches, etc.
Here is my gvimc.bat file that lets me start clean:

@echo off
if "%1" == "" goto instruct
if exist "%USERPROFILE%\_viminfo" del "%USERPROFILE%\_viminfo"
gvim %*
goto :EOF
:instruct
Echo "Usage:  gvimc file1 [file2] [file3] ..."

Try as I might, I still don't know how to access the %USERPROFILE%
from JScript (I prefer it to VBScript because it has more of the
options I use).  I am pretty sure you can, but I have waded through
an entire book and never found it.  Now that you have said this, I
need to move on to another thick book that covers ONLY JScript and
VBScript in more detail.  The thicker book is ignoring Windows Shell
Scripting.

I HAVE NO IDEA HOW IMPORTANT THIS IS TO WINDOWS PEOPLE!  If it is
important, I think Werner, Atom Smasher, and others may want to
reconsider this.  Without input from Windows people (I work on
Linux, OpenBSD, FreeBSD, MS Windows, Sun Solaris, and IBM AIX
in that order in terms of frequency) that work ONLY on Windows,
we are in the dark.  I suspect Werner is right.  It is a non issue
with Windows users since they probably use GnuPG just for signing
and encrypting email.  Now you know why I didn't send it to the
list. This note is NOT of general interest, and the added
functionality requested may not be important.  Then again, maybe
it is.

Henry Hertz Hobbit
-- 
Key Name:  "Henry Hertz Hobbit" <hhhobbit at securemecca.net>
pub   1024D/E1FA6C62 2005-04-11 [expires: 2006-04-11]
Key fingerprint = ACA0 B65B E20A 552E DFE2 EE1D 75B9 D818 E1FA 6C62





More information about the Gnupg-users mailing list