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

x/mobile: Not able to create files with os package #13330

Closed
ghost opened this issue Nov 19, 2015 · 4 comments
Closed

x/mobile: Not able to create files with os package #13330

ghost opened this issue Nov 19, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 19, 2015

I tried the following code on Galaxy S4 with Android 4.4.2:

package main
import (
"golang.org/x/mobile/app"
"golang.org/x/mobile/event/lifecycle"
"golang.org/x/mobile/event/paint"
"os"
)
func main() {
os.Create("zzz.txt")
app.Main(func(a app.App) {
for e := range a.Events() {
switch e := a.Filter(e).(type) {
case lifecycle.Event:
_=e
case paint.Event:
a.Publish()
}
}
})
}

However no file is created in the phone. I tried to specify a path but doesn't help.

I also tried an app called "AnGoIde" which allow us to write Go and compile directly in Android, and the following code is able to create the "zzz.txt" file:

package main
import "os"
func main(){
os.Create("zzz.txt")
}

@minux
Copy link
Member

minux commented Nov 19, 2015 via email

@ghost
Copy link
Author

ghost commented Nov 19, 2015

Please remove my comment if it should not appear in a bug report, but I have no idea what error os.Create is having since I don't know how to see the errors from phones, so I would like to write errors to a file with os.Create . Do you know any way I can see the errors without write to a file? thx..

@adg
Copy link
Contributor

adg commented Nov 19, 2015

cc @rakyll any advice on debugging this?

@kyle11rd https://golang.org/wiki/Questions

@minux
Copy link
Member

minux commented Nov 19, 2015 via email

@ghost ghost closed this as completed Nov 20, 2015
@golang golang locked and limited conversation to collaborators Nov 27, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants