The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Archive for August 19th, 2020

windows – Batch-file: undocumented wild card characters to check for file pattern existence – Stack Overflow

Posted by jpluimers on 2020/08/19

I wish I had known these undocumented wildcards exists like two decades ago: [WayBackwindows – Batch-file: Check if file with pattern exist – Stack Overflow, thanks Squashman:

There are undocumented wildcards that you can use to achieve this as well.

IF EXIST "D:\*Backup*.<" (
   ECHO "file exist"
) ELSE (
   ECHO "file not exist"
)

This wildcard option and other were discussed in length at the following two links.

From those links:

The following wildcard characters can be used in the pattern string.

Wildcard character  Meaning

* (asterisk)
Matches zero or more characters

? (question mark)
Matches a single character

" 
Matches either a period or zero characters beyond the name string

>
Matches any single character or, upon encountering a period or end of name string, advances the expression to the end of the set of contiguous >

<
Matches zero or more characters until encountering and matching the final . in the name

–jeroen

Posted in Batch-Files, Development, Scripting, Software Development | Leave a Comment »

TMonitor versus Critical sections revisited: when possible, use SRWL over TMonitor, then TCritical section

Posted by jpluimers on 2020/08/19

Via [WayBack] TMonitor vrs Critical sections revisited. Back then (https://www.delphitools.info/2013/06/06/tmonitor-vs-trtlcriticalsection/), it was found that critic… – Kiriakos Vlahos – Google+ as he re-did the measurements that DelphiTools did before Delphi XE5 came out:

Slim Reader/Writer Lock (SWRL) is even faster than TMonitor:

  • CriticalSection 0.035
  • TMonitor 0.019
  • SWRL 0.012

Of course if you have a speedy lock-free solution, that is always favourable, but few people know how to write lock free data structures or how to find the libraries (despite Julian Bucknall covering quite a few of them in Delphi back in the days).

Related:

–jeroen

Posted in Delphi, Development, Software Development | 4 Comments »