WalkbackFileName not set already in generic abt.icx

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

WalkbackFileName not set already in generic abt.icx

Wayne Johnston
I know the conventional wisdom about setting  walkbackFileName: - but our application had never done that, and we were happy to get a walkback.log file created in the 'current' directory.  But that has stopped working.  It turns out that it's only because WalkbackFileName is already set in the generic abt.icx, even as late as VA 8.0.2, but as of 8.5.1 and 8.5.2, it's nil.  I thought I'd at least point this out in case people search the forum for the issue.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/grqjC4dbhqkJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: WalkbackFileName not set already in generic abt.icx

Louis LaBrunda
Hi Wayne,

Is "walkback.log" okay or is a full path needed?

Lou

On Monday, September 24, 2012 3:39:23 PM UTC-4, Wayne Johnston wrote:
I know the conventional wisdom about setting  walkbackFileName: - but our application had never done that, and we were happy to get a walkback.log file created in the 'current' directory.  But that has stopped working.  It turns out that it's only because WalkbackFileName is already set in the generic abt.icx, even as late as VA 8.0.2, but as of 8.5.1 and 8.5.2, it's nil.  I thought I'd at least point this out in case people search the forum for the issue.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/QkOGnYBQvbUJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: WalkbackFileName not set already in generic abt.icx

Wayne Johnston
It's OK for us since we like it appearing in the current directory which is always writable.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/HcfKkBH7PHkJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: WalkbackFileName not set already in generic abt.icx

Louis LaBrunda
In reply to this post by Wayne Johnston
Hi Wayne,

Thanks for the answer.  I had some code that I ran at the start of a program that assumed the walkback was named walkback.log and was in the start up folder.  It would rename an existing walkback with an extension of lg1, lg2 or lg3 and cycle through them.

Now that I have to set the walkback name I decided to extend #CfsDirectoryDescriptor with two class methods (see below).  They look for walkbacks with a filename pattern of 'walkback*.log', where the "*" is a number.  The largest number is found and bumped by one.  The walkback filename is then set to this next in sequence name.

The discerning reader will notice that the code that determines the number part of the existing walkback filenames can be fooled by intervening non-digit characters (that are ignored).  I don't think this is a big deal or worth much work but if anyone has a suggestion, I will listen.

Note, if no walkback files exist in the directory, the walkback filename will be "walkback.log" (same as previous version of VA Smalltalk).

Lou

setNextWalkbackFileName
"Look for walkback*.log files in the startup folder, add 1 to the last # and use it for the walkback log filename."

^self setNextWalkbackFileName: self startUpDirectoryPath.

setNextWalkbackFileName: aPathString
"Look for walkback*.log files in the folder, add 1 to the last # and use it for the walkback log filename."
| dir file lastCount newCount fileCount thePath newWalkbackFileName |

thePath := (aPathString last == self pathSeparator) ifTrue: [aPathString] ifFalse: [aPathString copyWith: self pathSeparator].
dir := self opendir: thePath pattern: 'walkback*.log' mode: FREG.
[
file := dir readdir.
file notNil.
] whileTrue: [
fileCount := (file dName select: [:c | c isDigit]) asNumber.
lastCount := lastCount ifNil: [fileCount] ifNotNil: [:li | li max: fileCount].
].
dir closedir.
newCount := lastCount notNil ifTrue: [(lastCount + 1) printString] ifFalse: [''].
newWalkbackFileName := '%1walkback%2.log' bindWith: thePath with: newCount.
EsImageStartUp walkbackFileName: newWalkbackFileName.
^newWalkbackFileName.

On Monday, September 24, 2012 3:39:23 PM UTC-4, Wayne Johnston wrote:
I know the conventional wisdom about setting  walkbackFileName: - but our application had never done that, and we were happy to get a walkback.log file created in the 'current' directory.  But that has stopped working.  It turns out that it's only because WalkbackFileName is already set in the generic abt.icx, even as late as VA 8.0.2, but as of 8.5.1 and 8.5.2, it's nil.  I thought I'd at least point this out in case people search the forum for the issue.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/oV6KOI-mjzkJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: WalkbackFileName not set already in generic abt.icx

Wayne Johnston
In reply to this post by Wayne Johnston
I see a modern way to set the WalkbackFileName (and indeed how the supplied ini does it) is to set walkbackFilename in the [Kernel] stanza of the ini file.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.