long-to-short dir/filenames 
Author Message
 long-to-short dir/filenames



...

Quote:
>Nope. But I did marvel at your shameless hypocrisy and unabashed
>self-contradiction, again.

B/c I recommended a non-AWK solution (4DOS) ?
Exception noted - however, note that any DOS/Windows tool-based solution is
going to include a batch file, regardless of what underlying tool (AWK,
Perl, etc) is used.  So, by recommending 4DOS, I am recommending it as a
replacement for something that is already being used (by the OP).  I'm
saying that if you use the right batch file interpreter, then you won't need
any sub-tool to do this task (getting the SFN).

Quote:
>You recommended Perl.

Never!  I'd rather eat rusty nails.
That doesn't mean I don't use it on occasion, but I would never recommend it.

Quote:
>Just so we're clear on your opinion: Is Perl the handiwork of Lucifer
>and the embodiment of all that is evil in the world, or is it a viable
>programming language alternative to awk that fits neatly and naturally
>beside awk in any good programmer's toolbox?

No.  My general reaction to Perl is that you might as well write it in C.

Admittedly, this is a touchy-feely distinction, but Perl has the
look-and-feel of a 3GL much moreso than that of a 4GL.  One way of
visualizing this distinction is that AWK has the look of "I can just
use this thing" whereas Perl (as with C, fortran, and Pascal) has the
look of "I have to take a class - or at least get a book and study it"
(before I can do anything with it).

Now, having said that, note this may be a desirable trait.  The *problem*
with a language like AWK is that any schmoe *can* just jump in and start
using it.  This sort of thing can be the downfall of an organization...



Mon, 10 Feb 2003 03:00:00 GMT  
 long-to-short dir/filenames

Quote:

> You really want to be doing it in some tool that has direct access
> to the OS so that you can make the OS do the work for you. 4DOS,
> Perl, VBasic, etc, all meet this requirement.
> ^^^^


> > You recommended Perl.

> Never! I'd rather eat rusty nails.

Bon appetit, Monsieur Mangetout!

Quote:
> That doesn't mean I don't use it on occasion, but I would never
> recommend it.

Hypocritical and untrue.

--
Jim Monty

Tempe, Arizona USA



Mon, 10 Feb 2003 03:00:00 GMT  
 long-to-short dir/filenames


Quote:

>> You really want to be doing it in some tool that has direct access
>> to the OS so that you can make the OS do the work for you. 4DOS,
>> Perl, VBasic, etc, all meet this requirement.
>> ^^^^

C & Assembler also meet the requirement.

I would not recommend either of them (for this task) either.
I certainly would not recommend Visual Basic (the virus writer's choice!)



Mon, 10 Feb 2003 03:00:00 GMT  
 long-to-short dir/filenames

Quote:



>...
>>Nope. But I did marvel at your shameless hypocrisy and unabashed
>>self-contradiction, again.

>B/c I recommended a non-AWK solution (4DOS) ?
>Exception noted - however, note that any DOS/Windows tool-based
>solution is going to include a batch file, regardless of what
>underlying tool (AWK, Perl, etc) is used.  So, by recommending 4DOS, I
>am recommending it as a replacement for something that is already
>being used (by the OP).  I'm saying that if you use the right batch
>file interpreter, then you won't need any sub-tool to do this task
>(getting the SFN).

Foolishly barging into this illuminating discussion, this doesn't
require batch files/replacement command interpreter/shell, and it
doesn't require perl. Damn near every 32-bit Windows system with a
recent service patch will include the Windows Scripting Host, and that
facility would suffice to handle this, albeit not in a unix-like tools
and pipeline manner.

No need to pay for 4DOS, no need to commit acres of disk space to perl.
And anyone seriously endeavoring to program under Windows should learn
something about the many dialects of Visual Basic.

That said, the OP's problem was a system-related one. Awk is great for
text processing. It's not a shell replacement. Perl is. No points for
guessing which is better suited to the task. The only remaining
questions is whether we should have referred the original question to a
Windows newsgroup in the first place.

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 11 Feb 2003 03:00:00 GMT  
 long-to-short dir/filenames

<snip>

Quote:
>I certainly would not recommend Visual Basic (the virus writer's
>choice!)

An unusual role for me - defending Visual Basic. If you mean the Love
Bug virus, it was written in VBScript. It could just as easily have
been written in JavaScript. Hell, I've even created Lotus Notes forms
that automatically launch batch files upon being opened. Great fun
could be had by piping commands through DEBUG.COM.

It's not the scripting language, it's people who don't disable their
newsreader's facility for automatically opening files attached to e-
mail - or the fault of the company that doesn't make _disabled_ the
_default_ state.

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 11 Feb 2003 03:00:00 GMT  
 long-to-short dir/filenames

Quote:


> > w2k has   DIR /X for displaying SFN
> > w98 display SFN with a normal DIR
> > but both seems to not display the dir shortnames (perhaps you can see them

> So you are saying that Win2000 has no option displayed in dir /h which will
> provide short filenames for you?

No. He said it did, told us what it was (namely, /X), then explained
that this option doesn't display short *directory* (i.e., path)
names. I think this demonstrates what he meant:

C:\Program Files>dir /a:d /s /b /x | head
C:\Program Files\Windows NT
C:\Program Files\Plus!
C:\Program Files\Microsoft Chat
C:\Program Files\Uninstall Information
C:\Program Files\Web Publish
C:\Program Files\NetMeetingNT
C:\Program Files\Outlook Express
C:\Program Files\Microsoft FrontPage Express
C:\Program Files\Real
C:\Program Files\Common Files

C:\Program Files>dir /a:d /s /b | head | perl -lpe "$_ = Win32::GetShortPathName $_"
C:\PROGRA~1\WINDOW~1
C:\PROGRA~1\Plus!
C:\PROGRA~1\MICROS~1
C:\PROGRA~1\UNINST~1
C:\PROGRA~1\WEBPUB~1
C:\PROGRA~1\NETMEE~1
C:\PROGRA~1\OUTLOO~1
C:\PROGRA~1\MICROS~3
C:\PROGRA~1\Real
C:\PROGRA~1\COMMON~1

C:\Program Files>ver

Windows NT Version 4.0

C:\Program Files>

I assume Windows 2000 would produce the same result.

--
Jim Monty

Tempe, Arizona USA



Fri, 14 Feb 2003 03:00:00 GMT  
 long-to-short dir/filenames

Quote:
> So you are saying that Win2000 has no option displayed in dir /h which
will
> provide short filenames for you?

the fact is that the DIR /X in Windows 2000  only shows the short FILEnames,
not the entire path  (directories...)


Fri, 14 Feb 2003 03:00:00 GMT  
 
 [ 22 post ]  Go to page: [1] [2]

 Relevant Pages 
 

 
Powered by phpBB® Forum Software