/\/\o\/\/ PowerShelled

This blog has moved to http://ThePowerShellGuy.com Greetings /\/\o\/\/
$AtomFeed = ("Atom.xml")
$PreviousItems = (" Enhanced More Function for MSH "," Get driveletters for All drives (Providers) in MSH "," Math "," Exploring .NET types, classes and Enums from MSH "," Wipe the screen in MSH "," Blog series about Errorhandling in MSH "," This Month's line-break and Pipelines are Back "," [msh]cd.. "," MSH start. Function "," Argggg "," ")

Monday, November 14, 2005

 


MSH More replacement script update (HotFix)



In the More Replacement in last Post : Enhanced More Function for MSH
, I forgot to close the files opened by the script, as Keith Hill pointed out to me in the NG.

as well as a nice feature request, The Having statement as in C#.

because as you see in the fixes below I need to do it in 3 Places now

as there is no more input to read from the file :

if ($byte -ne -1){[void]$sb.Append([char]$byte)}
Else {$fs.close();$eof = $True;break}

If you skip to next file :

"F" {$fs.close();$eof = $true;}

If you Quit.

"Q" {$fs.close();$eof = $true;$Quit = $true}

and even then if you use Ctrl-C to Exit, you have chance it not gets closed
(I think it's possible to overrule this, will look into that later.)
and a trap should be used to close the file in case of an unforseen error.

when I have worked the mentioned issues out, I post them till then, mentioned changes will solve most cases, and will get you going.

gr /\/\o\/\/


Comments: Post a Comment



<< Home

Archives

October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006  

$Links = ("PowerShell RC1 Docs"," PowerShell RC1 X86"," PowerShell RC1 X64"," Monad GettingStarted guide"," Monad Progamming Guide"," Monad SDK"," Monad videos on Channel 9"," MSH Community Workspace"," scripts.readify.net "," MonadSource"," www.reskit.net"," PowerShell Blog"," Under The Stairs"," computerperformance powershell Home"," proudlyserving"," MSH on wikipedia"," MSHWiki Channel 9"," Keith Hill's Blog"," Precision Computing"," PowerShell for fun"," MSH Memo (Japanese)"," monadblog")

find-blog -about "PowerShell","Monad" | out-Technorati.
find-blog -contains "","" | out-Technorati.
Google
 
Web mow001.blogspot.com

This page is powered by Blogger. Isn't yours?