Created
July 8, 2012 18:17
-
-
Save h3rald/3072145 to your computer and use it in GitHub Desktop.
How to copy (or better, clone) files in Potion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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