将所有文件从子文件夹递归移动到父文件夹(Moving all files recursively from subfolders to parent)
我有一个名为“Music”的文件夹,它是我的父文件夹。 此文件夹包含许多.mp3-和.m4a文件,一些位于文件夹的根目录中,另一些位于子文件夹中,可以包含多个子文件夹。
如何在Mac上使用终端递归移动子文件夹中的所有文件,直到我的音乐文件夹的根目录并替换现有/重复文件?
谢谢!
I have a folder called "Music" which is my parent folder. This folder contains alot of .mp3- and .m4a-files, some in the root of the folder and others in subfolders that can have several subfolders.
How do I use terminal on my Mac to recursively move all files from the subfolder, up into the root of my Music folder and replace existing/duplicate files?
Thanks!
原文:https://stackoverflow.com/questions/35139189
最满意答案
deliver
方法,应在Mailer方法中调用。 但不是使用deliver
,而是使用deliver_now
或deliver_later
。将您的控制器更改为:
def create FamilyMailer.notify_family_member(FamilyMember.last).deliver_now end
和你的邮件:
class FamilyMailer < ApplicationMailer default from: "Gold<contact@goldyo.me>" def notify_family_member(family_member) puts "in the mailer" mail(to: family_member.email, subject: "Photos") end end
The
deliver
method, should be called at the Mailer method. But instead of usingdeliver
, usedeliver_now
ordeliver_later
.Change your controller to:
def create FamilyMailer.notify_family_member(FamilyMember.last).deliver_now end
And your mailer:
class FamilyMailer < ApplicationMailer default from: "Gold<contact@goldyo.me>" def notify_family_member(family_member) puts "in the mailer" mail(to: family_member.email, subject: "Photos") end end
相关问答
更多-
条件在控制台中工作但不在Web服务器中的rails(rails where condition works in console, but not in web server)[2022-03-24]
在你的控制器中,一种更易读的方法是使用复数形式来表示你期望超过1个对象 @products = Product.where("category_id = ?", @cat_id) 然后在视图中,只需循环遍历这些产品 <% @products.each do |product| %> <%= product.name %> <% end %> in your controller, a more readable way is to use the plural form to indicate th ... -
从你的评论中我感觉到element是dynamically附加的,而不是 $(".hopscotch-close").on('click', 你需要使用event-delegation $(document).on('click','.hopscotch-close',function(){ 那就行了。 如果你追加.hopscotch-close到任何已经存在的静态element那么而不是$(document).on('click'你可以使用$('#yourStaticElementId').on('c ...
-
尝试这个: $(document).ready(function() { $.getJSON("https://productinfo.com/api/product", function (el) { document.getElementById("heres").innerHTML = "Product price: " + el.price; }); }); Try this: $(document).ready(function() { $.getJSO ...
-
在初始页面加载循环期间执行文档就绪回调时,页面将不会完成加载图像数据。 由于没有图像数据,图像既没有宽度也没有高度。 使用$(window).on('load'...)而不是$(document).ready(...) I have answered my own question: I did the following and it works perfectly $(window).load(function () { // Run code $('.media-box-image') ...
-
deliver方法,应在Mailer方法中调用。 但不是使用deliver ,而是使用deliver_now或deliver_later 。 将您的控制器更改为: def create FamilyMailer.notify_family_member(FamilyMember.last).deliver_now end 和你的邮件: class FamilyMailer < ApplicationMailer default from: "Gold
" ... -
Python:flatten函数在控制台中工作,但不在文件中?(Python: flatten function works in console but not in file?)[2023-07-29]
问题在于你的扁平化功能只能展平一个层次。 doctest打印错误的原因是因为它确实是错误的。 他们不是你通过的。 File "test.py", line 5, in __main__.flatten Failed example: flatten([[9, [7, 1, 13, 2], 8], [7, 6]]) Expected: [9, 7, 1, 13, 2, 8, 7, 6] Got: [9, [7, 1, 13, 2], 8, 7, 6] 你应该调查一个递归的方法,而不是 ... -
“system”块中的命令在控制台中工作,但不在应用程序内部(Commands in the “system” block works in console but NOT inside application)[2022-11-17]
感谢上帝,我在这篇博文中找到了我的问题的答案: http : //blog.willj.net/2011/08/02/fixing-the-gemfile-not-found-bundlergemfilenotfound-error/ Thanks God I've found an answer to my question in this blog post: http://blog.willj.net/2011/08/02/fixing-the-gemfile-not-found-bundlergem ... -
问题解决了! 诀窍是,在'/app/mailers/user_mailer.rb'中,我有多字节字符。 在邮件主题。 所以我补充说: #encoding:UTF-8 在'/app/mailers/user_mailer.rb'的第一行 我发现这是完全意外:后来我的rails应用程序无法启动,服务器只是抛出HTTP 500错误。 所以没有痕迹,错误定义等。 我发现了多字节字符串:mail(to:email,subject:'Vašaregistráciaboladokončená。') 负责崩溃。 当我删除那 ...
-
你确定你的验证是有效的吗? session.auth = (self.app_id, self.api_key) 特别是,应将app_id设置为与API密钥对应的app_id(如果您使用的是测试应用,则为测试应用的app_id)。 如果内部通信收到一个应用程序ID,它不能识别它(当前)返回一个404,这是你所看到的。 现在应该修复以返回401。 Have you ensured that your authentication is valid? session.auth = (self.app_id, s ...
-
您是self_referencing Workflow模型所以 @workflow = Workflow.first @workflow.user 将返回id = @workflow.user_id 将关联更改为 class Workflow < ActiveRecord::Base belongs_to :user end Rails将自动在Workflow搜索user_id You are self_referencing to Workflow model so @workflow = Wor ...