简体   繁体   中英

API docs are confusing — Node.JS

I got this on fs.rename from the docs -- http://nodejs.org/api/fs.html

fs.rename(oldPath, newPath, callback)

Explanation:

Asynchronous rename(2). No arguments other than a possible exception are given to the completion callback.

However I don't really understand what this is because I am new to programming. Its a 2 word explanation with the explanation containing the word that it needs to explain:

What is fs. rename , Asynchronous rename .

I find this a bit annoying and confusing.

Same goes for this:

fs. ftruncate (fd, len, callback)

Explanation:

Asynchronous ftruncate (2).

A huge amount of the node api docs are like this and its giving me a hard time. Is there a better resource I can use to understand what these mean?

It's not "asynchronous rename", it's "asynchronous rename(2) ". The number in parens refers to the man page section it is found in, and section 2 is system calls. You are expected to read the man page ( man 2 rename in a terminal) in order to learn about the original synchronous function. The same applies to ftruncate(2) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM