4

Is it possible to create empty file in android source code with init rc script like we create folder. mkdir /tmp creates folder but touch /tmp/test doesn't do anything.

pls help

Damir
  • 1,092
  • 4
  • 18
  • 32
  • possible duplicate of [How to create directory automatically on SD card](http://stackoverflow.com/questions/2130932/how-to-create-directory-automatically-on-sd-card) – Devrim Jun 19 '14 at 18:24
  • I am asking how to create file with init.rc script in android source code not via androd app. – Damir Jun 19 '14 at 22:08

1 Answers1

5

the 'write' or 'copy' command works.

but please make ensure the commands are added after the filesystems are mounted, for example, at the end of "on post-fs-data"

    on post-fs-data
        ...
        write /data/non-empty-file 0
        ...
        copy /dev/null /data/empty-file
falcon
  • 51
  • 1