My google glass does not allow me to write or copy any file to its root folder (and do allow to the inner ones) - seems like a permissions problem. Moreover, when trying to run some .bat or .exe file - it also does not work. Is there a way to solve this issue?
1 Answers
My google glass does not allow me to write or copy any file to its root folder (and do allow to the inner ones) - seems like a permissions problem.
That's normal. For security reasons, you are not allowed to copy a file to some paths such as system partition (unless you have the right permission).
You can check ownership and permission by using adb and ls command.
ls -l
Here's my root directory:
$ adb shell ls -l /
drwxr-xr-x root root 2014-09-28 07:33 acct
drwxrwx--- system cache 2014-09-27 00:24 cache
-rwxr-x--- root root 264108 1969-12-31 19:00 charger
dr-x------ root root 2014-09-28 07:33 config
lrwxrwxrwx root root 2014-09-28 07:33 d -> /sys/kernel/debug
drwxrwx--x system system 2014-09-13 14:23 data
-rw-r--r-- root root 116 1969-12-31 19:00 default.prop
drwxr-xr-x root root 2014-09-28 07:33 dev
Also see http://en.wikipedia.org/wiki/File_system_permissions
Moreover, when trying to run some .bat or .exe file - it also does not work. Is there a way to solve this issue?
.bat and .exe are for Windows but GLASS is Android (Linux base) so you cannot run those types of file on GLASS.
.bat: The first filename extension used by Microsoft for batch files.
Note: If you are making an app (glassware) that can write a file to sdcard. You can try this:
// get the path to sdcard
File sdcard = Environment.getExternalStorageDirectory();
// to this path add a new directory path
File dir = new File(sdcard.getAbsolutePath() + “/your-dir-name/”);
// create this directory if not already created
dir.mkdir();
// create the file in which we will write the contents
File file = new File(dir, “My-File-Name.txt”);
FileOutputStream os = outStream = new FileOutputStream(file);
String data = “This is the content of my file”;
os.write(data.getBytes());
os.close();
// In the manifest
<uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” />
Hope this helps.
-
Thanks, but what I would like to do is this: after taking several photos and videos with the Glass, the files are stored in the glass memory. I would like to have some file (like bat script or something else) that will do the following: when I connect the USB and run some file, it automatically rename the files (photos, videos) in an increasing order and upload it to an ftp server. Is there a way to do that? (even via an android code) – Roi Bueno Sep 28 '14 at 14:23
-
@user2517096 sorry, i haven't tried ftb with Glass so i'm not sure but you can copy files to your local machine using adb e.g. adb pull /sdcard/DCIM/Camera Camera – pt2121 Sep 28 '14 at 15:26