I am using the output streams from the io module and writing to files. I want to be able to detect when I have written 1G of data to a file and then start writing to a second file. I can't seem to figure out how to determine how much data I have written to the file.
Is there something easy built in to io
? Or might I have to count the bytes before each write manually?
There are no limits on the size of the string (other than physical memory limits and processor address space limits). Depending on the number of channels and amount of data in the . txt file the maximum string limit is achieved when the . txt file is approximately 1 GB in size.
When uploading a project file, a Maximum File Size Exceeded error displays and you are not able to submit your project. This happens if your project file is larger than allowed.
if you are using this file for a logging purpose i suggest using the RotatingFileHandler in logging module like this:
import logging
import logging.handlers
file_name = 'test.log'
test_logger = logging.getLogger('Test')
handler = logging.handlers.RotatingFileHandler(file_name, maxBytes=10**9)
test_logger.addHandler(handler)
N.B: you can also use this method even if you don't use it for logging if you like doing hacks :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With