I have been trying using below code to read/write from S3 to K drive(local shared drive in our company) in AWS lambda function, but I am facing either 'Read-only file system' or 'No such file or directory' error. Could you please suggest what I should do?
Writing to K drive path (local shared disk drive) from S3
KDrive_path = 'K:\file.xlsx'
with open('/tmp/s3_kdrive.csv') as fs:
lines = fs.readlines()
with open(KDrive_path, 'wb') as ft:
ft.write(lines)
Reading from K drive path (local shared disk drive)
with open(KDrive_path) as fs:
lines = fs.readlines()
print(lines)
Thank you.