bluevw Posted March 16, 2016 Posted March 16, 2016 Hi all, Can someone tell me what the maximum amount of characters I can write with a single string command into a text file? Quote
cooper Posted March 17, 2016 Posted March 17, 2016 (edited) I'd say as much as the filesystem can retain in a single file, but it kinda depends on where the characters come from. UNIX while true; do echo "a" >> file ; done WINDOWS for /L %%n in (1,0,10) do ( echo "a" >> file ) To clarify that for loop, we're looping from 1 to 10 with an increment of 0, meaning an endless loop. Note that it may be VERY hard to break this loop, I haven't tried it myself but I've seen warnings. If you want it to happen FAST then instead of appending a single character, append the contents of the file to itself using cat(UNIX) or type(WINDOWS). Has to be in a loop still, but you'll quickly only be limited by the speed the disk can write the data to the file. Edited March 17, 2016 by cooper Quote
i8igmac Posted March 17, 2016 Posted March 17, 2016 I would think a string exist in ram. When ram is maxed out then you will discover the break point... BUFF="" 100,000,000.times do |x| BUFF<<x Puts BUFF.size # puts the buff size # buffer will grow by one, until the buffer is maxed out. End Quote
bluevw Posted March 18, 2016 Author Posted March 18, 2016 Thanks! I must be thinking about the string/payload issue wrong. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.