Question: I keep getting an IOException and I don't understand what it means.

Code (pseudo):

```
File file = new File("/filepath/");
fos = new FileOutputStream(file);
String str =  String.format("0");
fos.write(str.getBytes());
fos.close();

```

Error:

```
W/System.err( 1794): java.io.IOException: write failed: EBUSY (Device or resource busy)
W/System.err( 1794):  at libcore.io.IoBridge.write(IoBridge.java:452)
W/System.err( 1794):  at java.io.FileOutputStream.write(FileOutputStream.java:187)
W/System.err( 1794):  at java.io.OutputStream.write(OutputStream.java:82)

```

What does the "write failed: EBUSY (Device or resource busy)" part mean?

Answer: 
Sounds like the file you wanted to open is already in use. There are some related questions here on SO.

[open failed: EBUSY (Device or resource busy)](https://stackoverflow.com/questions/11539657/open-failed-ebusy-device-or-resource-busy) 

May due to debugging and starting you app all over again, the file is still in use.
If you search it online you will find that either a few processes use the file or you deleted the file but not the reference. You can try search for existence of the file before trying to write or do something with the file.
My solution would be to search for the existence of the file before doing something on it and if it exists delete and create new or something like that.

[open failed: EBUSY (Device or resource busy)](https://stackoverflow.com/questions/11539657/open-failed-ebusy-device-or-resource-busy)