" > dummy.txtįor /L %i in (1,1,21) do type dummy.txt > dummy. ![]() The second command, runs in a loop for 24 times, and each times doubles the size of the file, by appending it to itself.Ĭreate a 100MB file with real data : echo "This is just a sample line appended to create a big file. The first command(echo…) creates the file dummy.txt with 64 bytes. " > dummy.txtįor /L %i in (1,1,24) do type dummy.txt > dummy.txt Here is the method that can be used for java copy file using streams. Then we create InputStream from source and write it to the destination file using OutputStream for java copy file operation. Here we create two Files source and destination. echo "This is just a sample line appended to create a big file. Java Copy File Stream This is the conventional way of file copy in java. If you want to create 1 GB file you need to change the second command as below. The above commands create a 1 MB file dummy.txt within few seconds. (Run the above two commands one after another or you can add them to a batch file.) " > dummy.txtįor /L %i in (1,1,14) do type dummy.txt > dummy.txt ![]() echo "This is just a sample line appended to create a big file. If you want to create a file with real data then you can use the below command line script. Note that the above command creates a sparse file which does not have any real data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |