Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

stdout not flushed upon exit with output redirect #1669

@nzakas

Description

@nzakas

Using Node.js v0.4.10 on Ubuntu.

If I write a large amount of data to stdout, either via console.log() or process.stdout.write(), and then try to redirect the output to a file, the file remains empty even though the output never appears in the console. I'm not forcing the process to exit, it's completing its task and then exiting on its own. I expected stdout to flush at this point, but it appears not to.

This behavior can be seen with CSS Lint v0.5.0

npm install [email protected]
csslint some_css_file.css > results.txt

I tried working around this by using:

fs.writeSync(1, message);

However, this is causing other errors.

Is this behavior expected? If so, how can I ensure stdout is flushed so that output can be captured as usual?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions