deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

std/node/fs missing a lot of functionality

Open AliBasicCoder opened this issue 3 years ago • 15 comments

so, the problem is std/node/fs is missing a lot of functions:

EDIT: some were done

50/56

  • [x] fs.createReadStream
  • [x] fs.createWriteStream
  • [x] fs.fdatasync
  • [x] fs.fdatasyncSync
  • [x] fs.fstat
  • [x] fs.fstatSync
  • [x] fs.fsync
  • [x] fs.fsyncSync
  • [x] fs.ftruncate
  • [x] fs.ftruncateSync
  • [x] fs.futimes
  • [x] fs.futimesSync
  • [ ] fs.lchmod
  • [ ] fs.lchmodSync
  • [ ] fs.lutimes
  • [ ] fs.lutimesSync
  • [x] fs.link
  • [x] fs.linkSync
  • [x] fs.lstat
  • [x] fs.lstatSync
  • [x] fs.mkdtemp
  • [x] fs.mkdtempSync
  • [x] fs.open
  • [x] fs.opendir
  • [x] fs.opendirSync
  • [x] fs.read (with it's to overwrites)
  • [x] fs.readdir
  • [x] fs.readdirSync
  • [x] fs.readSync (with it's to overwrites)
  • [ ] fs.readv
  • [ ] fs.readvSync
  • [x] fs.realpath
  • [x] fs.realpath.native
  • [x] fs.realpathSync
  • [x] fs.realpathSync.native
  • [x] fs.rename
  • [x] fs.renameSync
  • [x] fs.rmdir
  • [x] fs.rmdirSync
  • [x] fs.stat
  • [x] fs.statSync
  • [x] fs.symlink
  • [x] fs.symlinkSync
  • [x] fs.truncate
  • [x] fs.truncateSync
  • [x] fs.unlink
  • [x] fs.unlinkSync
  • [x] fs.unwatchFile
  • [x] fs.utimes
  • [x] fs.utimesSync
  • [x] fs.watch
  • [x] fs.watchFile
  • [x] fs.write (with it's to overwrites)
  • [x] fs.writeSync (with it's to overwrites)
  • [x] fs.writev
  • [x] fs.writevSync

AliBasicCoder avatar Sep 25 '20 02:09 AliBasicCoder

i noticed that Deno.symlink doesn't exist ??

AliBasicCoder avatar Sep 25 '20 04:09 AliBasicCoder

symlink is unstable https://doc.deno.land/builtin/unstable#Deno.symlink

ry avatar Sep 25 '20 04:09 ry

see denoland/deno#7666

AliBasicCoder avatar Sep 25 '20 04:09 AliBasicCoder

Some of these have now been implemented, here's an updated checklist:

(Update(@kt3k): Removed the list of APIs with checkboxes here. We keep updating the list above)

Liamolucko avatar Nov 27 '20 07:11 Liamolucko

I would grab some, for a start I would go with mkdtemp/mkdtempSync. Anybody already on the case?

lp avatar Dec 02 '20 15:12 lp

@kt3k I see you updated this comment. i guess link and linkSync are implemented too.

I will send some PR`s for:

  • [x] fs.fdatasync
  • [x] fs.fdatasyncSync
  • [x] fs.fstat
  • [x] fs.fstatSync
  • [x] fs.fsync
  • [x] fs.fsyncSync
  • [x] fs.ftruncate
  • [x] fs.ftruncateSync
  • [x] fs.futimes
  • [x] fs.futimesSync

majidsajadi avatar Apr 01 '21 09:04 majidsajadi

may i work on this issue?

F3n67u avatar Aug 27 '21 11:08 F3n67u

@F3n67u yes, please do

bartlomieju avatar Aug 27 '21 11:08 bartlomieju

may i work on this issue?

please reference this issue in any PRs you're gonna create

AliBasicCoder avatar Aug 28 '21 13:08 AliBasicCoder

may i work on this issue?

please reference this issue in any PRs you're gonna create

@AliBasicCoder ok, I will

F3n67u avatar Aug 28 '21 13:08 F3n67u

@AliBasicCoder I tried to implement fs.opendir and fs.opendirSync, but looks like these methods are missing from deno fs api. @majidsajadi also mention this problem at https://github.com/denoland/deno_std/issues/802. I need to open issue at deno repo about the api Deno.opendir missing before I can implement the node counterpart, right?

F3n67u avatar Aug 29 '21 07:08 F3n67u

I'll work on fs.access https://nodejs.org/api/fs.html#fsaccesspath-mode-callback

kt3k avatar Dec 08 '21 08:12 kt3k

Implementing createReadStream would be awesome :pray:

(I'm rewriting a port of a Node.js framework and I need this func for readFile func)

talentlessguy avatar Mar 05 '22 14:03 talentlessguy

I believe the following are required from the Deno FS API to be implemented:

  • [ ] fs.lchmod
  • [ ] fs.lchmodSync
  • [ ] fs.lutimes
  • [ ] fs.lutimesSync
  • [ ] fs.readv
  • [ ] fs.readvSync

Is this correct?

iuioiua avatar Sep 08 '22 12:09 iuioiua

I guess the last 2 could be polyfilled if we don't mind the performance

kt3k avatar Sep 08 '22 16:09 kt3k