Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfelg!koren From: koren@hpfelg.HP.COM (Steve Koren) Newsgroups: comp.sys.amiga.tech Subject: Anybody know how to do this stuff? Message-ID: <13920020@hpfelg.HP.COM> Date: 28 Nov 89 16:25:46 GMT Organization: HP Elec. Design Div. -FtCollins Lines: 48 I have a few how-to-do-it style questions for knowlegable Amiga people. Probably email is best for responses; I'll summarize and post if there is sufficient interest. 1) How do you move bits around the filesystem as fast as possible? I am looking to improve the performance of the 'cp' command in SKsh. Right now, I have a loop that does a read() and a write() in 32K chunks (I've tried everything from 4K to 32K). However, c:copy still has a large performance advantage (for the FFS on a 28ms drive). 2) There's a command called something like "SetWindowTitles()" (I'm doing this from memory so that may not be the exact name). I can set the window title to anything I choose; I've found from experimentation that I need to AllocMem() the memory for the title so that it doesn't go away when my program terminates (since apparently SetWindowTitles() doesn't copy the string you give it, it just uses it directly). Well, that much is no problem. But I'd like to get rid of the space used by the *old* title. I am afraid to just FreeMem() it, though, since my program hasn't a clue where it came from. It *could* have been created by an AllocMem() call, or it could be a static string in some program. In the latter case, it would be quite rude to FreeMem() the string. How do I get rid of it if I don't know where it came from? (I can't just save it and put it back later since I am creating a stand-alone binary which changes the title). Also, if I assume it was AllocMem()ed, I don't know how big the buffer was. For example, it could have been 100 allocated bytes with a 20 byte string copied into it. Since FreeMem() needs to know the byte size, I wouldn't be freeing all the memory. 3) How do you execute a program when you know it is resident? I can get a pointer to a resident structure if I have the name; that's no problem. But I'm not sure what to do from there. I can't find a seglist in the structure anywhere. (Even if I had one, there's still the problem of BCPL programs being different thaan Lattice programs which are different from Manx programs which are different from programs compiled on Tuesday). Also, is the ARP resident list the same thing as the AmigaDos resident list? Does anyone have a short bit of code they'd be willing to pass along which executes resident programs? Even if I don't use it directly at least I could perhaps check it out to see how to do it. Any help would be greatly appreciated, thanks, - steve (koren@hpfela.HP.COM)