Hi

On Wednesday, October 23, 2019 at 9:15:02 PM UTC+5:30, Peng Yu wrote:
>
> I'd like to fs.writeFileSync() to the same file after reading its content 
> by fs.readFileSync(). It is not clear to me whether fs.closeSync() (or any 
> other file closing function) is needed between writeFileSync() and 
> readFileSync() according to the documentation. Would you please let me 
> know? Thanks.
>
> https://nodejs.org/api/fs.html
>

No. These two function are quite high level function that do not involve 
file descriptors, you are just passing a path. So I guess file opening and 
closing is handled underneath nodejs. I have used these two function 
extensively when starting up the the programs that runs in production, to 
read/write config files. Had no problems so far. 

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/cbf1c503-f06e-46e2-b8f4-ea83d4632e3d%40googlegroups.com.

Reply via email to