Read the guideline before start
Write an app that will move a file from one location to another like Linux mv
command: mv file.txt ./someDir/ (this will create file.txt in ./someDir
and remove the source file).
- If a destination contains
/in the end it must be considered as a directory. - In case destination directory does not exist an error must be thrown.
- The app must support only moving of files, and no additional options (flags).
Examples:
node index file.txt file2.txtsimply renames the file.node index file.txt ./existingDir/testmoves the file underexistingDirwith the nametest.node index file.txt dir/moves the file under thedir. In casedirdoes not exist an error is thrown.node index file.txt ain caseais an existing directoryfile.txtwill be moved to ./a/file.txt. Ifadoes not exist the file will be renamed to./a