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

Comments

Projects
None yet
3 participants
@ghost
Copy link

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

This comment has been minimized.

Copy link
Member

commented Nov 19, 2015

@ghost

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Contributor

commented Nov 19, 2015

cc @rakyll any advice on debugging this?

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

@minux

This comment has been minimized.

Copy link
Member

commented Nov 19, 2015

@ghost ghost closed this 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.
You can’t perform that action at this time.