Topic: Re: Big problem with Sys( ), possibly a bug (1 of 3), Read 24 times
Conf: Error messages, Crashes
From: Christian Ziemski
Date: Friday, May 12, 2006 05:33 PM

On Fri, 12 May 2006 11:44:00 -0400, Ted Green wrote:

>As I recall, you are shelling out with a DOS "Dir" command to get
>each file's date and size. The best solution is to use the new
>File_Stamp_Date() command to get each file date within the macro.

In COMPDIR I wanted to avoid a big loop with
File_Stamp_String(r,"file") and File_Size("file") commands.
Mainly for performance.
The DOS DIR command does what I want.

(Perhaps I'll find some time somewhere in the future to refactor
COMPDIR...)


For now I modified COMPDIR to work with long pathes too.

Here the relevant part of :SHELLOUT:


// Shell out with "dir" command to create a sorted list of files:
// The syntax with single AND double quotes is necessary because of
// long filenames (strange but true) ...
// The difference between NT/2000/XP and W9x must be handled
// carefully!
//
// T-Reg 15 contains something like:
// dir "d:\vedit\user-mac" /one > "C:\Vedit\temp\dir2.out"
// or
// dir "d:\vedit\user-mac" /one >
// "C:\DOKUME~1\CHRIST~1.W2\LOKALE~1\Temp\VeditTmp\dir2.out"
// dependent on the TEMP path and VEDIT settings regarding temp
// files.
//
//if (Is_WinNT) {
// Sys('"|@(15)"',DOS+SIMPLE+OK+SUPPRESS)
//} else {
// Sys('|@(15)',DOS+SIMPLE+OK+SUPPRESS)
//}
//
// Unfortunately the above syntax with Sys("|@(15)...) fails on long
// strings (~100 characters). This is an old DOS limitation.
//
// Fortunately the DOS box itself seems to have no such small limit
// (tested with cmd.exe in Win2000 only so far).
//
// So the following commands will work even with long pathes:
//
Reg_Save(15, "|(VEDIT_TEMP)\COMPDIR$.BAT", OK)
Sys("|(VEDIT_TEMP)\COMPDIR$.BAT",DOS+SIMPLE+OK+SUPPRESS)
File_Delete("|(VEDIT_TEMP)\COMPDIR$.BAT", OK+NOERR)

return()


I'll test it with W2k's command.com and Win98 too this weekend.


Christian

 


Topic: Re: Big problem with Sys( ), possibly a bug (2 of 3), Read 22 times
Conf: Error messages, Crashes
From: Ian Binnie
Date: Friday, May 12, 2006 09:23 PM

On 5/12/2006 5:33:55 PM, Christian Ziemski wrote:
>
>For now I modified COMPDIR to work with
>long pathes too.
>

Christistian,

I know you like to do things in Vedit, but you might be better to use a purpose designed free tool, which does the job better:-

https://sourceforge.net/projects/winmerge/

 


Topic: Re: Big problem with Sys( ), possibly a bug (3 of 3), Read 22 times
Conf: Error messages, Crashes
From: Christian Ziemski
Date: Saturday, May 13, 2006 01:59 AM

On Fri, 12 May 2006 21:23:00 -0400, Ian Binnie wrote:

>[COMPDIR]
>
>I know you like to do things in Vedit,

Yes, that way I can do things the way I like and I don't have to
switch application ;-)


>but you might be better
>to use a purpose designed free tool, which does the job better:-
>
>https://sourceforge.net/projects/winmerge/

I'm aware of those tools.
There are many of them (Winmerge is new to me, thanks for the link).


And yes, you are right: Sometimes it make sense to use special tools.


Christian