在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
最满意答案
编写一个使用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).
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
是的,你可以在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 ...
-
触发一个开始的过程(Trigger a process to start)[2023-06-30]
编写一个使用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 ... -
VBScript启动一个进程(vbscript start a process)[2023-05-24]
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 ...