Giter Site home page Giter Site logo

06-2-stream's Introduction

Тема 6. Buffer & Stream

Задание #2

Напишите функцию для чтения каталога, поиска всех текстовых файлов с расширением .txt и объединения их в один файл с использованием streams.

Функция должна принимать два параметра путь до каталога и название выходного файла Создайте Writable поток для записи данных в файл Файл располагается рядом с каталогом (не внутри) Функция должна прочитать каталог и найти все файлы с расширением txt Для каждого найденного текстового файла с расширением .txt. Добавьте Readable поток и подключите его к Writeble потоку, чтобы данные последовательно записывались в выходной файл. Перед данными каждого текстового файла должно быть название этого файла в квадратных скобках

пример:

3 txt файла

test/test1.txt (Привет мир!)

test/test2.txt (Hello world!)

test/qqq.txt (Stream Ready Steady Go)

Файл, который будет создан

[test1]
Привет мир!
[test2]
Hello world!
[qqq]
Stream Ready Steady Go

06-2-stream's People

Contributors

bisquitman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.