Author Topic: How can i copy file from source to target in AM?  (Read 7168 times)

zeroid

  • Full Member
  • ***
  • Posts: 30
    • View Profile
How can i copy file from source to target in AM?
« on: June 10, 2015, 01:00:05 AM »
I obviously dont see how I can do this.
I did tried to look at Squirrel to do it.
Apparently my C skills sucks and I only know C#.

Anyone would shine me a light would be very much appreciated.
Thanks in advance.

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: How can i copy file from source to target in AM?
« Reply #1 on: June 10, 2015, 09:03:34 AM »
There is no "copy" function. If you include the file module there is a ReadTextFile and WriteTextFile class you could use to for text.

If you are working with images, you'll need to use the builtin squirrel functions to read in the bytes, then write the byte back to the new location:
http://www.squirrel-lang.org/doc/sqstdlib3.html#d0e152

You can look at the file module code to see how to read/write files in squirrel..

The file module could use some updates to do some additional common file operations, so if you can create a copy(from,to) function - perhaps you can submit it to be included in that module? :)