SHARE
TWEET

NodeJS : Rename Nama File

stevennathaniel Jun 15th, 2016 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Created by StevenNathaniel on 16-Jun-16.
  3.  */
  4.  
  5. //source code untuk rename nama file di Windows
  6.  
  7. const fs = require('fs');
  8.  
  9. fs.rename("D:/StevenNathaniel/ProyekNodeJS/Webstorm1/test.txt", "D:/StevenNathaniel/ProyekNodeJS/Webstorm1/test1.txt", (err) => {
  10.  
  11.     if (err) throw err;
  12.  
  13.     fs.stat("D:/StevenNathaniel/ProyekNodeJS/Webstorm1/test1.txt", (err, stats) => {
  14.  
  15.  
  16. if (err) throw err;
  17.         console.log('stats: ${JSON.stringify(stats)}');
  18.     });
  19. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top