
This command creates a new file on disk and opens it for writing. If another file with the same name (or path) aready exists, the command is rejected by the module.
NEW requires two arguments. The first one is a handle number in the range from 0 to 100 which must be used in subsequent operations on that file, if NEW succeeds. The second and last argument is the name (or full path) of the new file.
ERR_OK (0) if a new file was created and openend for writing.
ERR_ID_USED (27) if the supplied handle number is already in use.
ERR_FILE_OPEN (32) if a file with the same name is already open.
ERR_FIL_EXHAUSTED (26) if the file system has not enough memory to allocate file management information.
ERR_FR_... (13...25) file system errors if something's going wrong while creating or accessing the file.
NEW 1 hello.txt
Creates a new file named "hello.txt" in the root directory and opens it as handle #1
This command only exists on modules with some kind of mass storage (SD-Card or USB stick).