Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Copying files in amos  (Read 4251 times)

0 Members and 1 Guest are viewing this topic.

rja4096

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
Copying files in amos
« on: November 22, 2007, 10:51:40 AM »

Hi, I'm nearly ready to show you all my driving game, just one thing, how do I get amos to copy some files from code. it must be possible.

Please let me know, thanks, Rick.
Logged

rednova

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 225
    • http://www.feryogi.com
Re: Copying files in amos
« Reply #1 on: November 22, 2007, 06:53:48 PM »

Friend:
I am looking forward to see your game. You need to copy an amos code file? The easy way to do that would be to open/load the code in amos, then 'save as' and save under a different name.
Cheers!!!

rednova
-mobilis in mobile-
Logged
-mobilis in mobile-

rja4096

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
Re: Copying files in amos
« Reply #2 on: November 23, 2007, 07:47:19 AM »

Hi, I'm looking forward to seeing my game too!

No, sorry I was not clear, about copying files. What i have is 30 IFF files, an amimation done in Dpaint, which is an amimation of a road moving. I need top copy these from disk to RAM disk. When the program runs it loads these one by one and displays on the screen, then mack to the start. I could create a script and have the CLI copy the files, but would like this all to be done in AMOS if possible.

Thanks, Rick.
Logged

Spellcoder

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 27
    • Amiga Coding WIKI
Re: Copying files in amos
« Reply #3 on: November 23, 2007, 09:37:31 AM »

METHOD 1 - use an external copy command
If you're using AMOSPro you could use the Exec instruction.

Exec 'copy oldfile RAM:newfile'

If you use the old AMOS you could use an =Doscall for the same effect.


METHOD 2 - use an extension
Maybe one of the extensions has a instruction for copying.


METHOD 3 - code your own copy function
Otherwise To do it without the C:Copy file you'd have to open the old and new file
and then load part of the file, save that part, load the next part etc.
This way you don't need an external command or extension.
The reason to do the copying in pieces is to save memory and can halfway stop your program.


edit: fixed links.. apparently the forum software doesn't like me to quote the URL :P
edit (feb 2008): updated the links
« Last Edit: February 15, 2008, 07:22:13 PM by Spellcoder »
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Copying files in amos
« Reply #4 on: November 23, 2007, 09:25:37 PM »

Actually you could use RedNova's suggestion (assuming that each frame is a static IFF image):
Code: [Select]
For I=1 to 30
  Load IFF "filename"+Str$(I)
  Save IFF "ram:filename"+Str$(I)
Next I
Logged

rednova

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 225
    • http://www.feryogi.com
Re: Copying files in amos
« Reply #5 on: November 23, 2007, 09:39:41 PM »

Samurai Crow:

hehe thanks for mentioning my name!!! Now i feel really good!!!
cheers!!!

rednova
-mobilis in mobile-
Logged
-mobilis in mobile-

Tarzin

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 35
    • Ami-France
Re: Copying files in amos
« Reply #6 on: January 16, 2009, 06:14:18 AM »

Quote
Exec 'copy oldfile RAM:newfile'
This method is working fine! Thanks for the tip.
I've used it for my AmosPro's french installer.

Quote
If you use the old AMOS you could use an =Doscall for the same effect.
Althought, this link is broken.
Logged
Power User! :-)
A500/1Mo + 2nd floppy drive

WinUAE 1.5.x / OS 3.9 BB2 / Amikit 1.x.
http://amifrance.hw.tc/

AmiGame, Ultimate FrontEnd for WinUAE!
http://www.amigame.fr/

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Copying files in amos
« Reply #7 on: January 16, 2009, 10:28:39 PM »

Logged

woody.cool

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
Re: Copying files in amos
« Reply #8 on: April 07, 2013, 03:47:44 PM »

Sorry to resurrect an old thread, you can copy files thus:

Code: [Select]
Openin 1,src$
l=lof(1)
reserve as work 1,l
close 1
bload src$,1
bsave dest$,start(1) to start(1)+l
erase 1

You can use that to copy ANY file, be it ASCII or binary.
Another option, if you have AMCAF, you'll have the FILE COPY command available to you ;)
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022