repl.txt (1700B)
1 2 {{alias}}( path, clbk ) 3 Asynchronously removes a directory entry. 4 5 If a provided path is a symbolic link, the function removes the symbolic 6 link named by the path and does not affect any file or directory named by 7 the contents of the symbolic link. 8 9 Otherwise, the function removes the link named by the provided path and 10 decrements the link count of the file referenced by the link. 11 12 When a file's link count becomes 0 and no process has the file open, the 13 space occupied by the file is freed and the file is no longer accessible. 14 15 If one or more processes have the file open when the last link is removed, 16 the link is removed before the function returns; however, the removal of 17 file contents is postponed until all references to the file are closed. 18 19 If the path refers to a socket, FIFO, or device, processes which have the 20 object open may continue to use it. 21 22 The path argument should *not* be a directory. To remove a directory, use 23 rmdir(). 24 25 Parameters 26 ---------- 27 path: string|Buffer|integer 28 Entry path. 29 30 clbk: Function 31 Callback to invoke upon removing an entry. 32 33 Examples 34 -------- 35 > function done( error ) { 36 ... if ( error ) { 37 ... console.error( error.message ); 38 ... } 39 ... }; 40 > {{alias}}( './beep/boop.txt', done ); 41 42 43 {{alias}}.sync( path ) 44 Synchronously removes a directory entry. 45 46 Parameters 47 ---------- 48 path: string|Buffer|integer 49 Entry path. 50 51 Returns 52 ------- 53 out: Error|null 54 Error object or null. 55 56 Examples 57 -------- 58 > var out = {{alias}}.sync( './beep/boop.txt' ); 59 60 See Also 61 -------- 62