Pydzik45

KEK

Oct 28th, 2020
1,037
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2. var fs = require('fs');
  3. const { Writable } = require('stream');
  4.  
  5. // ZAD 1
  6. //var fileList = fs.readdir('./', function (error, fileList) {
  7. //  console.log(error);
  8. //  console.log(fileList);
  9. //});
  10.  
  11.  
  12. // ZAD 2
  13. //fs.readFile('./modules.txt', 'utf-8', function (error, content) {
  14. //  console.log(content);
  15. //});
  16.  
  17.  
  18. // ZAD 3
  19. //fs.unlink('./footer.html', function (error) {
  20. //  if (error) {
  21. //      console.log(error);
  22. //  }
  23. //});
  24.  
  25.  
  26. // ZAD 4
  27. //fs.mkdir('scripts', function (error) {
  28. //  if (error) {
  29. //      console.log(error);
  30. //  } else {
  31. //      console.log('Katalog zostal utworzony');
  32. //      fs.rename('scripts', 'styles', function (error) {
  33. //          if (error) {
  34. //              console.log(error);
  35. //          } else {
  36. //              console.log('Nazwa katalogu zostala zmieniona');
  37. //              fs.rmdir('styles', function (error) {
  38. //                  if (error) {
  39. //                      console.log(error);
  40. //                  } else {
  41. //                      console.log('Katalog usuniety');
  42. //                  }
  43. //              });
  44. //          }
  45. //      });
  46. //  }
  47. //});
  48.  
  49.  
  50. // ZAD 6
  51. //const buf1 = new Buffer('this is t�st');
  52. //console.log(buf1.toString());
  53. //console.log(buf1.toString('ascii'));
  54. //const buf2 = new Buffer('7468697320697320612074c3a97374', 'hex');
  55. //console.log(buf2.toString());
  56.  
  57.  
  58. // ZAD 7
  59. //var bufer = new Buffer('Bufor');
  60. //console.log(bufer);
  61. //console.log(bufer.toString());
  62. //console.log(bufer.toJSON());
  63. //console.log(bufer[0]);
  64. //bufer.write('abcde');
  65. //console.log(bufer.toString());
  66.  
  67.  
  68. // ZAD 8
  69. //var readable = fs.createReadStream('./data.txt', { encoding: 'utf-8' });
  70.  
  71. //var writeable = fs.createWriteStream('./data_COPY.txt');
  72.  
  73. //readable.on('data', function (chunk) {
  74. //  writeable.write(chunk);
  75. //});
RAW Paste Data