1
我有一个C#lambda函数创建一个简单的.txt文件是这样的:如何创建和上传文件到亚马逊S3
string file = Path.DirectorySeparatorChar + "tmp" + Path.DirectorySeparatorChar + "file.txt";
File.Create(file);
然后我试图把它上传到S3
TransferUtility fileTransferUtility = new TransferUtility(new AmazonS3Client(Amazon.RegionEndpoint.EUWest1));
fileTransferUtility.Upload(file, MyBucketNameInString);
但是,它返回这个错误:
File createdOne or more errors occurred. (The process cannot access the file '/tmp/file.txt' because it is being used by another process.): AggregateException
任何解决方案吗?
是/tmp/file.txt在文本编辑器或其它程序打开文件? – Ehz