vinyl icon indicating copy to clipboard operation
vinyl copied to clipboard

Enhanced stat object

Open phated opened this issue 8 years ago • 7 comments

Opening this as the solution to a bunch of other issues.

This to achieve:

  • *nix-like behavior for atime/mtime/etc properties (#72)
  • Virtual directories (#100)
  • User-friendly mode property (gulpjs/vinyl-fs#112)
  • Construct with always-valid properties (new fs.Stats doesn't do this)
  • Flag remote files (isRemote) and avoid path normalization or do URI normalization (#127)
  • More?

phated avatar Sep 07 '16 18:09 phated

Do we have a status update on this issue @phated? How close to complete is this?

I'm running into some issues where we are trying to pass around a Vinyl stat object into existing fs based interfaces that expect a regular fs based stat object.

Marak avatar Oct 15 '17 13:10 Marak

@Marak Approximately 0% - Vinyl's stat object is still just constructed by fs.Stat. I created a repository at https://github.com/gulpjs/better-stats but no one was interested in helping out so this will fall to the future.

phated avatar Oct 15 '17 22:10 phated

Quoting "steps" as outlined in https://github.com/gulp-community/gulp-less/pull/303#issuecomment-422440248

Basically the way I see it working is:

  • better-stats would be created to do exactly that - a better stats object, and it would handle the ctime (mode change) attribute automatically any time it was changed
  • a vinyl instance would handle updating its stats atime (access time) and mtime (modify time) whenever the contents attribute was modified (Buffer.is to compare), or stream was piped to something (would be tricky to determine if the output as actually changed or not, but possible). Would probably want to use a proxy here.
  • vinyl-fs would need to be modified to work with the new stat objects, and support setting ctime/mtime/atime properly on write in dest.

I'm pretty sure we'd need to work on a BetterBuffer object that would interact with BetterStats but I'm not sure, as I haven't looked into it at all.

phated avatar Nov 04 '18 20:11 phated

Picking this one up and assigning to myself. @phated I noticed a lot of work has been done on better-stats, can you give a quick update on what is still missing + your plans for that? I want to make sure I don't reinvent the wheel if you've already made API decisions for that.

yocontra avatar Apr 28 '20 01:04 yocontra

Any news on this? We just ran into problems caused by gulp (4.0.2) not updating the last-modified property on overwritten/updated files (on Node.js 12.18.3).

VividVisions avatar Oct 05 '20 09:10 VividVisions

Unfortunately, no one has begun work on this yet. @VividVisions would you want to help out?

phated avatar Oct 14 '20 22:10 phated

@phated I'm sorry, but I fear I don't have the necessary time to dive into this. :(

VividVisions avatar Oct 22 '20 18:10 VividVisions