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

Commands like add and files write don't detect pipes on Windows #3266

Closed
mateon1 opened this issue Sep 27, 2016 · 6 comments
Closed

Commands like add and files write don't detect pipes on Windows #3266

mateon1 opened this issue Sep 27, 2016 · 6 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature topic/windows Windows specific

Comments

@mateon1
Copy link
Contributor

mateon1 commented Sep 27, 2016

Version information:

go-ipfs version: 0.4.4-dev-73cd8b3
Repo version: 4
System version: amd64/windows
Golang version: go1.7

Type: Bug

Priority: P3

Description:

As the title says, commands like ipfs add and ipfs files write don't detect whether they are being piped into on Windows.
This doesn't allow to add files into ipfs or mfs with a single step, as in echo text | ipfs add or echo text | ipfs files write /path/in/mfs.
(instead echo text > file; ipfs add file; ipfs files cp /ipfs/hash /path/in/mfs; rm file has to be used)

@Kubuxu
Copy link
Member

Kubuxu commented Sep 27, 2016

Yes we have stdin piping explicitly disabled on windows, I don't know was is the reasoning behind it, but @whyrusleeping might know more about it.

@Kubuxu Kubuxu added kind/enhancement A net-new feature or improvement to an existing feature status/deferred Conscious decision to pause or backlog topic/windows Windows specific labels Sep 27, 2016
@whyrusleeping
Copy link
Member

I think i recall the reason for this had something to do with stdin being much more difficult to handle on windows than on linux.

Its explicitly disabled here: https://github.com/ipfs/go-ipfs/blob/master/commands/cli/parse.go#L258

@mateon1 feel free to experiment with that, if you find that everything works just fine, then please do PR a removal of that special casing.

@dysbulic
Copy link

dysbulic commented Feb 4, 2017

A more descriptive error message would be useful, particularly because this affects the getting started tutorial.

Also, this is likely only necessary for the Windows console, since Cygwin's bash is from the same source as everyone elses'.

@whyrusleeping
Copy link
Member

@dysbulic good point, we should check what shell we're in instead of just checking operating system here

@Kubuxu
Copy link
Member

Kubuxu commented Feb 5, 2017

Cygwin console works by recompiling everything with linux'y libc and it is the reason why stdin is sane then but I have no idea how will Go stdin handling behave then if it isn't sane on Windows.

It seems to me that we have to rediscover the reason why stdin handling was disabled on Windows in the first place, maybe it can be re-enabled without any problems.

@whyrusleeping
Copy link
Member

@Kubuxu I think the original reason it was disabled was because it didnt work properly on windows cmd.exe

@ghost ghost removed the status/deferred Conscious decision to pause or backlog label Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature topic/windows Windows specific
Projects
None yet
Development

No branches or pull requests

4 participants