Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add null source to diff bindings #203

Open
naturallymitchell opened this issue Jan 12, 2019 · 9 comments
Open

add null source to diff bindings #203

naturallymitchell opened this issue Jan 12, 2019 · 9 comments

Comments

@naturallymitchell
Copy link
Member

https://doc.rust-lang.org/std/process/struct.Stdio.html#method.null

from #174

//cc @sineemore

@dariusc93
Copy link
Contributor

Stdio::null() is used to ignore any io sent to a child process created by Command. This doesnt really allow direct usage to /dev/null. You would want to open /dev/null or just have a handler to open it directly and use that for whatever is being nullified/ignored/etc.

@dariusc93
Copy link
Contributor

I did reread what is said in that issue and I do believe that he is not referring to using /dev/null directly but to just replace the file if it doesnt exist with /dev/null (which is more dependent on unix-like systems) so I am going to close this for the time being.

@sineemore
Copy link
Contributor

Yes, the whole point is to specify a non-existent file. /dev/null suits well, as Windows OSes doesn't have similar file. Also, IIRC, git does it exactly this way.

It is possible to specify an empty file some other way, but this may break original patch/diff support.

@sineemore
Copy link
Contributor

This is probably related to changeutils/diff-rs#6

@naturallymitchell
Copy link
Member Author

/dev/null suits well, as Windows OSes doesn't have similar file

https://superuser.com/questions/134214/is-there-an-equivalent-to-dev-null-in-windows

but regardless, Cmder is basically "Linux"

(which is more dependent on unix-like systems)

that's everything afaict. win and droid aren't on any major departure, given Cmder and Termux

You would want to open /dev/null or just have a handler to open it directly and use that for whatever is being nullified/ignored/etc.

Yes, the whole point is to specify a non-existent file.

this makes a lot of sense..

I think it should go in sys/null or something rather than fs

@sineemore
Copy link
Contributor

I think it should go in sys/null or something rather than fs

This will be much cleaner, than using something like /dev/null.
But filenames in diff must be actual filenames or the original patch program might not work.

@sineemore
Copy link
Contributor

But it's clear we don't need the bindings for null device.
It can be handled within diff bindings interface: ability to specify non-existent file and its proper handling.

@naturallymitchell naturallymitchell changed the title /dev/null bindings add null source to diff bindings Jan 27, 2019
@naturallymitchell
Copy link
Member Author

k. renamed

@dariusc93
Copy link
Contributor

Implemented in 02d58da

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants