What is the best way to copy a file? I want to sync 2 folders (with subfolders), but the only way that work is the following: http://www.rebol.com/article/0281.html I found it a bit complex. Is there a simpler way?
That method is only really needed for large files ( many Mbs ) .. otherwise read/write/binary should be okay.
Just a quick note about <i>moving</i> files (not useful in syncing, but a related topic): read/write/delete works, but rename gives MUCH faster performance.
Why do I obtain the following error? Code: compare: func [ file1 file2][ write/binary file1 (read/binary file2) ] Script Error: Cannot use insert on this type port ** Where: compare ** Near: write/binary file1 (read/binary file2)
When you use the function, are you being sure to pass file values (%) as the parameters: Code: compare %temp1.txt %temp.txt
I think it's always good practice to specify the parameter types too. The brackets are not necessary. Code: compare: func [ file1 [file!] file2 [file!] ][ write/binary file1 read/binary file2 ]