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
|
|