how can creat a empety text file whit a special size? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how can creat a empety text file whit a special size?

e.g 1000 mb

3rd Feb 2017, 3:41 PM
fghtfm
fghtfm - avatar
2 Answers
+ 5
Depends of what language you would use, but I think opening a new file stream in binary mode, writing to it how many bytes you want to be the file size with any values, except the first byte to be EOF special ascii byte should be work ( with a 'txt' filename extention should be opened in text editor as empty file )... theorycally ( I've not tried :P )
4th Feb 2017, 10:03 AM
visph
visph - avatar
+ 2
by putting 1000mb of data in it. Although I doubt it will remain empty. You can do it with pictures by parsing the binary content of two files together zipping the result and changing the file extension. I think text files will show some binary data no matter what, but I'm not sure as I did not try it yet. Search "hiding files into pictures as shown on cheap pathetic detective drama series".
3rd Feb 2017, 4:33 PM
seamiki
seamiki - avatar