首页 \ 问答 \ 在iOS应用程序中删除S3存储桶中的文件(Swift)(Deleting file from S3 bucket in iOS app (Swift))

在iOS应用程序中删除S3存储桶中的文件(Swift)(Deleting file from S3 bucket in iOS app (Swift))

我正在Swift中编写iOS应用程序,并使用Amazon S3存储文件。 我想知道是否有人知道如何以命令方式删除我的S3存储桶中的文件(而不是在存储桶生命周期中设置删除策略)。

提前致谢


I am writing an iOS app in Swift, and am using Amazon S3 to store files. I was wondering if anyone knows how I can programmatically delete files in my S3 bucket on command (instead of setting a delete policy in the bucket lifecycle).

Thanks in advance


原文:https://stackoverflow.com/questions/38190097
更新时间:2022-05-04 10:05

最满意答案

编写一个使用filewatcher监视新文件的Windows服务。 https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx

然后,可以使用File.Move将文件移出并进入备用目录以进行进一步处理。 https://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx

我会使用一个Task和一个task.continuewith来启动工作流程的下一个“阶段”等。可能还想首先执行文件COPY,然后删除文件(而不是移动,如果有的话在复制期间拧紧,你仍然可以使用你的原件)。


Write a windows service which uses a filewatcher to monitor for new files. https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx

That can then use File.Move to move the file out and into the alternate directory for further processing. https://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx

I would use a Task for this and a task.continuewith to kick off the next 'stage' of your workflow, etc. Might also want to do a file COPY first, then a file delete (instead of a move, that way if something screws up during the copy you still have your original to work with).

相关问答

更多
  • 是的,你可以在Silverlight 4中(在浏览器外提升完全信任),例如: dynamic cmd = AutomationFactory.CreateObject("WScript.Shell"); cmd.Run("calc.exe", 1, true); Yes, you can in Silverlight 4 (in out-of-browser with elevated full trust), example: dynamic cmd = AutomationFactory.Create ...
  • 应用领域和跨域互动是一件非常薄的事情,所以应该确保他真正了解事情在做任何事情之前的工作...嗯...让我们说,“非标准”:-) 首先,您的流创建方法实际上在您的“默认”域执行(惊喜!)。 为什么? 简单:您传入AppDomain.DoCallBack的方法是在AppDomainDelegateWrapper对象上定义的,该对象存在于您的默认域上,因此它的方法将被执行。 MSDN不会说这个小小的“功能”,但是很容易检查:只需在AppDomainDelegateWrapper.Invoke设置一个断点。 所以, ...
  • 你确定文件夹“ c:\teste ”存在吗? 如果没有,浏览器将打开显示一些默认文件夹(在我的情况下为“ C:\Users\[user name]\Documents ”)。 更新 我尝试了以下变体: // opens the folder in explorer Process.Start(@"c:\temp"); // opens the folder in explorer Process.Start("explorer.exe", @"c:\temp"); // throws exception P ...
  • 编写一个使用filewatcher监视新文件的Windows服务。 https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx 然后,可以使用File.Move将文件移出并进入备用目录以进行进一步处理。 https://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx 我会使用一个Task和一个task.contin ...
  • start内置到cmd.exe ; 这不是一个实际的程序。 WSHShell.Run需要一个物理文件,而不是内置的cmd 。 因此,您可以编写WSHShell.Run("calc.exe") start is built-in to cmd.exe; it's not an actual program. WSHShell.Run takes a physical file , not a cmd built-in. Therefore, you can write WSHShell.Run("calc.e ...
  • 尝试这个: delimiter $$ Create TRIGGER MYtrigger AFTER INSERT trigger.customer BEGIN INSERT INTO trigger.transaction (Name, Surname, Age, Exchange) VALUES (new.Name, new.Surname, new.Age, new.Amount*rate.Rate); END;$$ delimiter ; 这就是说,你现在有一个r ...
  • 如果不指定工作目录,则新进程将继承进程的工作目录。 也就是说,新进程将继承调用Process.Start()的进程的工作目录。 这是启动MyApp的两次尝试之间的唯一区别。 其中一个继承了工作目录,其中一个指定了它。 很明显, MyApp不喜欢以最初的工作目录作为父进程的目录运行。 为何如此,我无法肯定地说。 看起来MyApp在启动时尝试了一些XML解析。 所以也许这个XML解析读取一个推测在工作目录中的文件。 但实际上该文件与可执行文件位于同一目录中。 如果是这种情况,那么您需要修改MyApp来解决问题。 ...
  • 如果你的表是TASK表,那么你的触发器会在行存在之前触发,所以如果该工作流正在检查你要插入的行中的数据,那么毫无疑问它会失败。 也是COMMIT; 在触发器中非常糟糕(如果插入多于1行,则会失败)。 if your table is the TASK table, then your trigger is firing BEFORE the row exists, so if that workflow is checking for data in the row you're inserting the ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)