ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Fs(file system) module
    Search: NodeJs NodeJs 2023. 1. 14. 21:30

    fs - file, directory, 파일, 디렉토리, 관련

     

    fs.rename(oldPath, newPath, callback)
    fs.renameSync(oldPath, newPath)
    fs.ftruncate(fd, len, callback)
    fs.ftruncateSync(fd, len)
    fs.truncate(path, len, callback)
    fs.truncateSync(path, len)
    fs.chown(path, uid, gid, callback)
    fs.chownSync(path, uid, gid)
    fs.fchown(fd, uid, gid, callback)
    fs.fchownSync(fd, uid, gid)
    fs.lchown(path, uid, gid, callback)
    fs.lchownSync(path, uid, gid)
    fs.chmod(path, mode, callback)
    fs.chmodSync(path, mode)
    fs.fchmod(fd, mode, callback)
    fs.fchmodSync(fd, mode)
    fs.lchmod(path, mode, callback)
    fs.lchmodSync(path, mode)
    fs.stat(path, callback)
    fs.lstat(path, callback)
    fs.fstat(fd, callback)
    fs.statSync(path)
    fs.lstatSync(path)
    fs.fstatSync(fd)
    fs.link(srcpath, dstpath, callback)
    fs.linkSync(srcpath, dstpath)
    fs.symlink(srcpath, dstpath, [type], callback)
    fs.symlinkSync(srcpath, dstpath, [type])
    fs.readlink(path, callback)
    fs.readlinkSync(path)
    fs.realpath(path, [cache], callback)
    fs.realpathSync(path, [cache])
    fs.unlink(path, callback)
    fs.unlinkSync(path)
    fs.rmdir(path, callback)
    fs.rmdirSync(path)
    fs.mkdir(path, [mode], callback)
    fs.mkdirSync(path, [mode])
    fs.readdir(path, callback)
    fs.readdirSync(path)
    fs.close(fd, callback)
    fs.closeSync(fd)
    fs.open(path, flags, [mode], callback)
    fs.openSync(path, flags, [mode])
    fs.utimes(path, atime, mtime, callback)
    fs.utimesSync(path, atime, mtime)
    fs.futimes(fd, atime, mtime, callback)
    fs.futimesSync(fd, atime, mtime)
    fs.fsync(fd, callback)
    fs.fsyncSync(fd)
    fs.write(fd, buffer, offset, length, position, callback)
    fs.writeSync(fd, buffer, offset, length, position)
    fs.read(fd, buffer, offset, length, position, callback)
    fs.readSync(fd, buffer, offset, length, position)
    fs.readFile(filename, [options], callback)
    fs.readFileSync(filename, [options])
    fs.writeFile(filename, data, [options], callback)
    fs.writeFileSync(filename, data, [options])
    fs.appendFile(filename, data, [options], callback)
    fs.appendFileSync(filename, data, [options])
    fs.watchFile(filename, [options], listener)
    fs.unwatchFile(filename, [listener])
    fs.watch(filename, [options], [listener])
    Caveats
    Availability
    Filename Argument
    fs.exists(path, callback)
    fs.existsSync(path)
    Class: fs.Stats
    fs.createReadStream(path, [options])
    Class: fs.ReadStream
    Event: 'open'
    fs.createWriteStream(path, [options])
    Class: fs.WriteStream
    Event: 'open'
    file.bytesWritten
    Class: fs.FSWatcher
    watcher.close()
    Event: 'change'
    Event: 'error'

     

    https://www.w3schools.com/nodejs/nodejs_filesystem.asp

     

    https://opentutorials.org/module/938/7373

     

    https://nodejs.dev/en/learn/working-with-folders-in-nodejs/

     

     

     

    'NodeJs' 카테고리의 다른 글

    Bootstrap 설치하기  (0) 2023.01.22
    Formidable IncomingForm() 값 Ex  (0) 2023.01.16
    Nodejs request.on() data, end Ex  (0) 2023.01.15
    Nodejs Express bodyParser  (0) 2023.01.15
    http status codes를 enum 이름으로 처리  (0) 2022.12.25
    Styled-components  (1) 2022.12.24
    Module not found: Can't resolve 'fs'  (0) 2022.12.24
    npm --save  (0) 2022.12.23

    댓글