Locates files in the PATH-listed directories
PathLocate is a small command line utility that allows you to quickly search for files located in directories listed in the PATH environment variable.
The program allows you to enter many names/masks of files on one command line, limit the number of returned files, ignore or take into account the size of characters, calculate CRC32 checksums, display the last modification time of files, their size, VersionInfo block from executable files (on Windows) and other.
This program was made for my private use, but it may also be useful to someone.
PathLocate can be useful for administrators to quickly locate executable files, check their version, as well as in batch files for making decisions in the absence of any files necessary for the proper operation of the script.
CodeTyphon Programming Studio.
After small modifications, the program can also be compiled in the Lazarus IDE.
- My Pascal units (JPL* files in the units directory).
- Modified Free Pascal units (MFPC* files in the units directory).
- Wolfgang Ehrhardt's hashing units (all files in the units\we directory).
- Extract 7z archive with source files.
- Open src\PathLocate.ctpr with CodeTyphon.
- Set build mode.
Select menu A new window will appear.
In the tree view (on the left), select Compiler Options.
At the top of this window you can select the build mode from the dropdown list.
Select build mode for your system and CPU.
- Build project (menu ).
- Compilation in a new version of the CodeTyphon.
- [+] Calculation of MD5, SHA-1 and SHA-2-256 checksums. Switches:
--md5 --sha1 --sha2
- [+] Highlighting of executable files: EXE, DLL, BAT, CMD, BPL (on Windows), and SH, SO (on Linux). Switches:
-he -hd -hb -hc -hp -hs -hl
- [+] Highlighting the text provided by the user. Switches:
- [+] Sorting. Switches:
- [+] Displaying the list of directories specified in the PATH environment variable. Switch
- [+] Long format switch:
- [+] The user can define the text used to separate categories of information. Switches:
- [+] Displaying more detailed information about errors. Switch
- [+] Displaying the creation (Windows only), last write and last access time of found files. Switches:
-dc -dw -da
- [+] The ability to display file attributes on Windows system. Switch:
- [+] Displaying the short version info (and nothing more). It can be useful for detecting the PathLocate version from batch files. Switch
- [+] [Linux] Detecting if the output is a character device (terminal, printer). If so, the PathLocate will use ANSI escape codes to display colors. If not, ANSI codes will not be generated by the program. As a result, the output data stream can be redirected to a file/pipe, and it will not be "cluttered" with unnecessary data.