English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

 
 
Thread Tools
Old 09 January 2024, 14:28   #1
pixie
Registered User
 
pixie's Avatar
 
Join Date: May 2020
Location: Figueira da Foz
Posts: 361
Getting Version values into text

I would like to use List so I could automatically comment the version of each command. The thing is I cannot find a version command that allows me to pipe its result to a text file.

If I do:

version c:dir >t:dir.ver

It gives nothing but an empty file.
pixie is offline  
Old 09 January 2024, 15:09   #2
Snoopy1234
Registered User
 
Snoopy1234's Avatar
 
Join Date: Apr 2022
Location: Australia
Age: 52
Posts: 843
try version c:dir >t:dir.ver.txt
Snoopy1234 is offline  
Old 09 January 2024, 15:35   #3
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,180
just did it using a small script to help automate it.

Code:
.KEY FILENAME/A
IF EXISTS <FILENAME>
  Filenote <FILENAME> "`Version <FILENAME>`" QUIET
ENDIF
saved the above as C:FILEVERSION and protected it +S to make it an executable script.

then typed

Code:
LIST C:#? LFORMAT "FILEVERSION %P%N" >RAM:DOIT
This produces a file filled with stuff like...
Code:
FILEVERSION C:xUp
FILEVERSION C:xType
FILEVERSION C:xScan
FILEVERSION C:xQuery
FILEVERSION C:xPack
FILEVERSION C:xPK
FILEVERSION C:xLoadSeg
FILEVERSION C:xDir
FILEVERSION C:xBench
FILEVERSION C:wpa_passphrase
FILEVERSION C:winlaunch
FILEVERSION C:whdload-updated
FILEVERSION C:wget
FILEVERSION C:uuidgen
FILEVERSION C:untgz
FILEVERSION C:translate
thats a small snippet, but you get the idea.

then just executed the file in RAM:, any/all files in C: get a filenote of the version string "IF" one exists. Not sure how to fudge that into a 1 line or 1 file solution. also had to add "FAILAT 100" at the top of the DOIT file as it errors out when a version string does nto exist. in fact the above kinda needs a better way to deal with no string found as it currently lumps the version error text into the filenote using the above when no version is found, someone smarter can probably fix that issue in a clever way.

Last edited by DisasterIncarna; 09 January 2024 at 15:42.
DisasterIncarna is offline  
Old 09 January 2024, 16:23   #4
pixie
Registered User
 
pixie's Avatar
 
Join Date: May 2020
Location: Figueira da Foz
Posts: 361
:O easy as pie! Thanks a lot! That worked beautifully
pixie is offline  
Old 09 January 2024, 20:37   #5
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,231
Quote:
Originally Posted by DisasterIncarna View Post
j
Code:
LIST C:#? LFORMAT "FILEVERSION %P%N" >RAM:DOIT
Not sure how to fudge that into a 1 line or 1 file solution.
By creating the "FILEVERSION" command with the << input redirection of the shell and piping the output of the LIST command to execute:


Code:
LIST C:#? LFORMAT "FILEVERSION %P%N" | EXECUTE
Thomas Richter is offline  
Old 09 January 2024, 23:14   #6
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,180
Quote:
Originally Posted by Thomas Richter View Post
By creating the "FILEVERSION" command with the << input redirection of the shell and piping the output of the LIST command to execute:


Code:
LIST C:#? LFORMAT "FILEVERSION %P%N" | EXECUTE
Ah nice way to do it.

1 problem with the little solution i used is that if no version string is present then the error output is added as a filenote (Could not find version Information for C:FileName, Version failed, returncode 20) rather than nothing, any idea if there is a better way to suppress that unwanted output from the Version command?

At a guess i think something would need to be added to the script when an error/failat 20 occurs so maybe an empty/blank filenote is added to overwrite the error string that gets added currently, maybe thats overkill and a simpler solution exists.
DisasterIncarna is offline  
Old 09 January 2024, 23:45   #7
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,640
Version command output redirection works fine here, maybe you are using some old buggy version.
Minuous is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
SetPeriod does not seem to like values I am inputting Amiga1992 Coders. Blitz Basic 8 10 March 2021 00:28
Default display values chip support.WinUAE 6 06 January 2018 14:00
Finegrain_cpu_speed values hexaae support.WinUAE 2 14 August 2016 14:36
Discretizing / Normalizing Values in C/C++ Zetr0 Coders. General 4 04 December 2006 09:29

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:15.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07932 seconds with 13 queries