Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Vince Fatica how about reenabling @FILEREADI ?

May
609
4
Vince, I've been using your 4UTILS plugin relying on @FILEREADI, @FILEREADX, INC, DEC, and some other functions and commands which are not included the latest version of 4UTILS.DLL that is on your website. When I "upgraded" and installed your latest version, many of my .BAT files failed, of course.

Would you please consider restoring the commands and functions which you removed, or perhaps putting those into a separate plugin?
 
Those are long gone and I suspect it would be much easier for you to work around the difficulties than for me to rewrite them. INC and DEC are almost trivial (maybe with aliases) and, IIRC, @FILEREAD* could be done with a couple user_defined functions based on @FILEREADB.
 
Thanks for the response, Vince. Sure, INC and DEC are trivial. I'm looking into reading a file into a buffer with @FILEREADB, and then using @BPEEK to get values, but @BPEEK has no support for signed numbers (which I've already requested), nor for integers with non 1-2-4-8 lengths. (I have a file with both 3-byte and 6-byte integers!).

Okay, another idea. Is there a way I could mung the old 4UTILS.DLL so it has a different internal name (like, 4XTILS), so that TCC would load both the old and the new versions?
 
Okay, another idea. Is there a way I could mung the old 4UTILS.DLL so it has a different internal name (like, 4XTILS), so that TCC would load both the old and the new versions?
That's a good question. I'm only guessing, but I think there are only two places where the name matters, the name of the on-disk file, and internally, where I supply the PLUGININFO structure to TCC. In a hex editor, that second place looks like this. Below, the location of that text is probably not valid; it's from MY 4UTILS.DLL which I doubt is the same as the one on the FTP site.

1728349172285.webp


It might work if you changed that one and the file name. And I don't think you'd have to worry about naming the plugin when you called something in it. The ones you're missing would only be found in one plugin, and for other items, which plugin it came from wouldn't (shouldn't) matter. Maybe I'll try your idea later.
 
This seems like a rather convoluted approach to me. Why not just break the desired features out into a whole new plugin? Give it a different name, and Bob's your uncle.
 
Creating a new plugin would be quite a chore. I haven't done it in years and I don't care to do it on demand. I don't think many people use my plugins. I've tried a couple times to make a VisualStudio template for a new plugin and didn't come up with anything usable.
 
In that case, you wouldn't mind if I give it a stab, would you? These look like genuinely useful features, and I can even think of a few potential improvements.
 
In that case, you wouldn't mind if I give it a stab, would you? These look like genuinely useful features, and I can even think of a few potential improvements.
Not at all; go right ahead. You're always free to duplicate and, especially, improve on, anything I have done.
 
Vince,

I actually tried using a hex editor to change the internal name, and renamed the result to the same external name. TCC barged on loading it.
I appreciate the effort you're going through.
 
Vince,

I actually tried using a hex editor to change the internal name, and renamed the result to the same external name. TCC barged on loading it.
I appreciate the effort you're going through.
That strategy worked for me.
 
Maybe I did something wrong; I'll try again. Okay, I did some experimentation.

1. The filename does not matter (as long as it ends in .DLL). PLUGIN /L somedir:somename.DLL TCC will load this, but the plugin name that TCC shows is always 4UTILS.

2. Editing the internal name does not matter. TCC always knows that it's 4UTILS.

3. Loading any version of 4UTILS after a version is already loaded results in a TCC message that 4UTILS is already loaded, and then TCC exits.

Code:
Module:      C:\Program Files\JPSoft\TCMD\plugins\4Utils64old.dll
Name:        4UTILS
Author:      Vincent Fatica
Email:       moc.rr.yncwt@snigulp
Web:
Description: Various utilities
Implements:  ,@AGEDATEF,@ASCIIHEX,@AVG,@CIDRTOIP,@CLOCK,@DEC2HEX,@DEQUOTE,@DLEVEL,@DNS,@DOWCVT,@DTMARK,@DTPLUS,@DU,@EMPTY,@EXECW,@FDATE,@FILEREADI,@FILEREADX,@FILEWRITEX,@FMTBY
TE,@FTIME,@GEV,@GV,@HEXTOIP,@IFILESIZE,@IFILETIME,@IPTOCIDR,@IPTOHEX,@ISLEAP,@ISUSB,@LC,@LSB,@MSB,@MONCVT,@MRAND,@MRANDSEED,@NEWEST,@NOOP,@OLDEST,@OVERWRITE,@PARSEF,@PARSEW,@PP
,@PROD,@PRODEX,@SEQ,@SET,@SREPEAT,@SUM,@SUMEX,@TCONVERT,@UCODEHEX,@UNIXTIME,CD,CDIN,CDNEXT,CDPREV,CLOCK,DEC,DIRSORT,DNS,DROPTOCLIP,ET,EVAL,FCONVERT,FILETIMES,GSET,HIRESTIME,INC
,LC,NOOP,NOTAGS,PERMUTE,SETERR,TCCD,TODROP,UHELP,UPDATEENV,WAIT,_AGENOW,_CDIN,_CDNEXT,_CDPREV,_CLIPLINES,_CONHOST,_D8,_DESK,_DESKS,_DLEVEL,_ENVVARS,_ENVCOUNT,_HIRESTIME,_INETAD
DR,_INETNAME,_INKEY,_IODESK,_MODKEYS,_MRAND,_N,_NHANDLES,_NOOP,_NTHREADS,_PRIORITY,_PROCSESS,_PROFILES,_PROGMAN,_STARTUPCMD,_SYSSESS,_T6,_T9,_T12,_TCCCOUNT,_TCCEXEWIN,_TCCPATH,
_TCHOSTWIN,_UNIXTIME,_UTC,_WORKSET,_ZSCORE
Version:     2019.527  Build 215026

       These 3 files are all the same except for the internal name which are 4UTILS, 4XTILS, and X4TILS, respectively:

C:\Users\DCantor\Work> dir \temp\*.dll

 Volume in drive C is Windows-SSD  Serial number is 5853:97e1
 Directory of  C:\temp\*.dll

02-15-2020  13:17         215,040  4Utils64.dll
10-07-2024  21:44         215,040  4Xtils64.dll
10-10-2024  23:31         215,040  x4tils.dll
             645,120 bytes in 3 files and 0 dirs    651,264 bytes allocated
     159,781,953,536 bytes free

C:\Users\DCantor\Work> plugin /l c:\temp\x4tils.dll
TCC: Plugin already loaded 4UTILS
      -- and then the TCC windows closed --
 
Last edited:
Messing with a different approach: I have uploaded a new plugin here: FileReadX plugin

This is an attempt to recreate Vincent's @FILEREADI, @FILEREADX, @FILEWRITEX, and also INC and DEC, in a syntax-compatible way.
 
Charles, thank you. I will test that in my environment later today.
Vince, thank you for all the time you put in working on this.
 
Back
Top