Welcome!

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

SignUp Now!

Date range question

May
3,515
5
Help topic "dateranges.htm" includes the paragraph: "Instead of a date, you
can specify a file age for the first and/or second parameter (not supported
in TCC/LE). See Time Stamps, @AGEDATE and @MAKEAGE." No example is given.
Would the range
/[d%@fileage[%_cmdspec]]
correctly specify "same age or newer than the command processor"? Experiment
shows this to be true. How would I specify "newer than the specified file"
(i.e., exclude the specified file)?
--
Steve
 
I would have thought that /[d%@inc[%@fileage[%_cmdspec]]] would do it,
but it doesn't seem to. Curious.

On Mon, Mar 8, 2010 at 11:28 AM, Steve Fábián <> wrote:


> Help topic "dateranges.htm" includes the paragraph: "Instead of a date, you
> can specify a file age for the first and/or second parameter (not supported
> in TCC/LE). See Time Stamps, @AGEDATE and @MAKEAGE." No example is given.
> Would the range
> /[d%@fileage[%_cmdspec]]
> correctly specify "same age or newer than the command processor"?
> Experiment
> shows this to be true. How would I specify "newer than the specified file"
> (i.e., exclude the specified file)?
> --
> Steve
>
>
>
>
>
>
>
>



--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
| I would have thought that /[d%@inc[%@fileage[%_cmdspec]]] would
| do it, but it doesn't seem to. Curious.

That's because @inc added only 100 ns - way below the date range resolution.
Working on your idea, I found that /d%@eval[%@fileage[%_cmdspec]+7674676]]
included tcc.exe, but /[d%@eval[%@fileage[%_cmdspec]+7674677]] did not. The
fileage of tcc.exe on my system is 129123635112325323, so the limiting
worked when the age specified was the next second.
Just a little bit tricky. I just created a function:

function nxt=`%@eval[( %@fileage[%1] \ 10000000 + 1 ) * 10000000 ]`

which allows the desired operation:

/[d%nxt[%_cmdspec]]


Note that for FAT/FAT32/VFAT you may need to change the 1s = 10,000,000 *
100ns to 2s...
--
Steve
 
| I would have thought that /[d%@inc[%@fileage[%_cmdspec]]] would
| do it, but it doesn't seem to. Curious.

That's because @inc added only 100 ns - way below the date range resolution.
Working on your idea, I found that /d%@eval[%@fileage[%_cmdspec]+7674676]]
included tcc.exe, but /[d%@eval[%@fileage[%_cmdspec]+7674677]] did not. The
fileage of tcc.exe on my system is 129123635112325323, so the limiting
worked when the age specified was the next second.
Just a little bit tricky. I just created a function:

function nxt=`%@eval[( %@fileage[%1] \ 10000000 + 1 ) * 10000000 ]`

which allows the desired operation:

/[d%nxt[%_cmdspec]]


Note that for FAT/FAT32/VFAT you may need to change the 1s = 10,000,000 *
100ns to 2s...
--
Steve


Since the least significant 7 digits seem to be irrelevant, you might simplify that to
Code:
function nxt=`%@eval[%@fileage[%1] + 10000000]`
 
| Since the least significant 7 digits seem to be irrelevant, you
| might simplify that to
|
| Code:
| ---------
| function nxt=`%@eval[%@fileage[%1] + 10000000]`
| ---------

Dave, based on your suggestion I made it even simpler, depending on the fact that the AGE is converted to a character string by the parser before it is used. The version below mostly just manipulates the strings:

Code:
---------
function nxt=`%@inc[%@left[-7,%@fileage[%1]]]0000000`
---------
--
Steve
 
Back
Top
[FOX] Ultimate Translator
Translate