Hi,
I want to copy a file to the web directory if it's greater than a certain size. The file size is always > 15K
The following runs without any errors, but fails to copy the file in question.
------------------------------------------------------------
file_size = os.path.getsize('cronJob.html')
if file_size > 3000:
shutil.copy('/home/cdr/Logs/cronJob.html', fileName)
else:
pass
------------------------------------------------------------
If I omit the test for file size and just run:
shutil.copy('/home/cdr/Logs/cronJob.html', fileName)
all works OK.
I have checked the data type for file_size, which is long and anything else I can think of.
Best Regards.
I want to copy a file to the web directory if it's greater than a certain size. The file size is always > 15K
The following runs without any errors, but fails to copy the file in question.
------------------------------------------------------------
file_size = os.path.getsize('cronJob.html')
if file_size > 3000:
shutil.copy('/home/cdr/Logs/cronJob.html', fileName)
else:
pass
------------------------------------------------------------
If I omit the test for file size and just run:
shutil.copy('/home/cdr/Logs/cronJob.html', fileName)
all works OK.
I have checked the data type for file_size, which is long and anything else I can think of.
Best Regards.