www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/31/21:02:12

Sender: nate AT cartsys DOT com
Message-ID: <35EB394C.703981CD@cartsys.com>
Date: Mon, 31 Aug 1998 17:01:16 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: "John M. Aldrich" <fighteer AT cs DOT net>
CC: djgpp AT delorie DOT com
Subject: Re: Game loop
References: <6s2mth$c70$1 AT towncrier DOT cc DOT monash DOT edu DOT au> <35E73645 DOT B77D2CE5 AT cs DOT net>

John M. Aldrich wrote:
> There is also gettimeofday(), whose fields have
> a microsecond resolution.

Though not necessarily a microsecond *precision*-- beware!
-- 

Nate Eldredge
nate AT cartsys DOT com


mp
> 
> And change it to another filename... But since "filename.bmp" could be
> anything, how do I search for this string? Basically, I'd need to search
> for "Wallpaper=" and then change the entire line to something else.

A tool already exists that can do this; it's called `sed'.  It's a
little complicated, but probably something like this will work:

sed "s/^Wallpaper=.*/New Contents Of Line/" <win.ini >new-win.ini

This translates as:  Read contents of `win.ini', replace occurences of
["Wallpaper=" at the beginning of a line followed by anything] with "New
Contents of Line", and write the result to `new-win.ini', which you can
then rename over `win.ini'.

Those who do not understand `sed' are doomed to reinvent it.  (--Some
poster whose name I've forgotten)
-- 

Nate Eldredge
nate AT cartsys DOT com


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019