3

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?

1 Answer 1

3

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).

Sign up to request clarification or add additional context in comments.

2 Comments

It would be better if you would note that both rename and fturncate are C functions from the C standard library. While most old-school programmers would immediately recognize fturncate a lot of people starting to learn programming these days don't know C so they won't know what you are talking about.
@Zachooz: man is the name of a program. It's the original online documentation system for Unix and is available on Linux and MacOS X. If you are on windows or don't have man installed then yes, use that website

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.