filer
filer copied to clipboard
Adding in support for fs.copyFile.
I noticed that Filer does not support fs.copyFile. What's your opinion on me taking on writing out the code/doing a test for this? Difficult or good feature to work on? @humphd
Nice catch, I didn't realize node had added this to fs
. Yes, I think it would be good to have it. Why don't you start by writing a test and submit that, then seen where you're at. You could always use the full implementation as another release later in the course if you find it's too big.
In the simplest case, a copyFile
is basically:
function copyFile(src, dest, flags, callback) {
// Deal with flags, which could be something we add in future PRs...
fs.readFile(src, null, (err) => {
if(err) {
return callback(err);
}
fs.writeFile(dest, null, callback);
});
}
Alright, I'll take a crack at it, if you don't mind.
Hi, how is it going with the test, anything you would like to work on together?
@YuechengWu I'm not sure if @Mordax is doing just the implementation or if she is doing tests too. Would be great if you two could collaborate somehow.
@humphd I took your advice and I'm currently working on the tests first and implementation later. Besides the regular testing, copyFile has some flags that we can test out, @YuechengWu. So there is some more work there.
Agree, doing tests for all those various flags, even if we don't land an implementation for them all, would be good.
@Mordax Hi Mordax, what is your name on slack? It would be easier for us to communicate that way if you want.
@YuechengWu Sent you a message ✌️
#481 has added some basic tests for this, currently skipped.