Skip to content

Instantly share code, notes, and snippets.

@h3rald
Created July 8, 2012 18:17
Show Gist options
  • Save h3rald/3072145 to your computer and use it in GitHub Desktop.
Save h3rald/3072145 to your computer and use it in GitHub Desktop.
How to copy (or better, clone) files in Potion
Path = class (path): /path = path.
Path read = ():
file = File (/path, "r+")
r = file read (100)
contents = (r)
while (r != nil):
r = file read (100)
contents append (r)
.
contents join
.
Path write = (contents):
File (/path, "w+") write (contents).
Path append = (contents):
File (/path, "a+") write (contents).
Path copy = (dest):
Path (dest) write (self read).
Path ("INSTALL.md") copy ("INSTALL_copy.md")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment