Create a blank .txt file

256 views
Skip to first unread message

Richard Wallace

unread,
Jun 2, 2015, 2:26:16 PM6/2/15
to tas...@googlegroups.com
This is probably very straightforward and I'm just missing something...
I can't seem to create a 100% blank text file.
He create file action demands some text, so I put a space.
When I use the read file action with the result stored in %text, %text shows as being set but empty...makes sense I guess.

So can you create a totally blank text file, so if I was to read that file, the resulting variable would not be set?

nanobrain

unread,
Jun 2, 2015, 3:19:32 PM6/2/15
to tas...@googlegroups.com
If you have busybox installed, give the shell command "touch" a shot. touch filename should just create a 0 byte file

Juergen Gruen

unread,
Jun 2, 2015, 3:51:37 PM6/2/15
to tas...@googlegroups.com
This is probably very straightforward and I'm just missing something...
It is not too straightforward, I guess ;-)
 
I can't seem to create a 100% blank text file.
Can be done, using JavaScriptlet:
writeFile("/sdcard/test.txt", "",false);

 
He create file action demands some text, so I put a space.
When I use the read file action with the result stored in %text, %text shows as being set but empty...makes sense I guess.
%text is not empty, it contains the character ASCII 32 (space):
space: " "  
empty
string: ""


So can you create a totally blank text file, so if I was to read that file, the resulting variable would not be set?
No, the resulting variable would always be set (to an empty string), even if you read a blank text file.

Hope this is understandable and not too confusing...

Here is some more information: https://groups.google.com/forum/#!searchin/tasker/empty/tasker/t01Bj-gL9Jg/x-Ax9P-44cgJ (Sorry, link button not working(?))

Juergen.
Reply all
Reply to author
Forward
0 new messages