Overwriting files in an emacs dired buffer using move or copy












4















When copying or moving a file/files in a dired buffer sometimes the file already exists in the location one is moving or copying to. Emacs then prompts the user and asks whether to "overwrite" the existing file or not. One is given these options: y/n/!/q or C-h. However, one cannot tell if there is any difference in size (or date) between the two files, the one already in the directory and the one being copied. This is crucial information, for at times one would like to keep a larger file or a smaller one. Is there a way of displaying this information or not?










share|improve this question













migrated from superuser.com Dec 31 '18 at 16:54


This question came from our site for computer enthusiasts and power users.



















  • If the file already exists in the Dired directory then its date and size are also available there. This might require you to use g to refresh the listing, or ( to unhide details. And it might require you to use search, to get to that file in the listing. If the target directory is not already shown in a Dired buffer then it will require you to visit that directory. And you'll probably need to first quit the copy/move/etc. operation, to check the info, and then relaunch the operation.

    – Drew
    Dec 31 '18 at 19:02











  • You could modify the message and prompt, to add an option to list the file(s) in question, including their details.

    – Drew
    Dec 31 '18 at 19:03
















4















When copying or moving a file/files in a dired buffer sometimes the file already exists in the location one is moving or copying to. Emacs then prompts the user and asks whether to "overwrite" the existing file or not. One is given these options: y/n/!/q or C-h. However, one cannot tell if there is any difference in size (or date) between the two files, the one already in the directory and the one being copied. This is crucial information, for at times one would like to keep a larger file or a smaller one. Is there a way of displaying this information or not?










share|improve this question













migrated from superuser.com Dec 31 '18 at 16:54


This question came from our site for computer enthusiasts and power users.



















  • If the file already exists in the Dired directory then its date and size are also available there. This might require you to use g to refresh the listing, or ( to unhide details. And it might require you to use search, to get to that file in the listing. If the target directory is not already shown in a Dired buffer then it will require you to visit that directory. And you'll probably need to first quit the copy/move/etc. operation, to check the info, and then relaunch the operation.

    – Drew
    Dec 31 '18 at 19:02











  • You could modify the message and prompt, to add an option to list the file(s) in question, including their details.

    – Drew
    Dec 31 '18 at 19:03














4












4








4








When copying or moving a file/files in a dired buffer sometimes the file already exists in the location one is moving or copying to. Emacs then prompts the user and asks whether to "overwrite" the existing file or not. One is given these options: y/n/!/q or C-h. However, one cannot tell if there is any difference in size (or date) between the two files, the one already in the directory and the one being copied. This is crucial information, for at times one would like to keep a larger file or a smaller one. Is there a way of displaying this information or not?










share|improve this question














When copying or moving a file/files in a dired buffer sometimes the file already exists in the location one is moving or copying to. Emacs then prompts the user and asks whether to "overwrite" the existing file or not. One is given these options: y/n/!/q or C-h. However, one cannot tell if there is any difference in size (or date) between the two files, the one already in the directory and the one being copied. This is crucial information, for at times one would like to keep a larger file or a smaller one. Is there a way of displaying this information or not?







overwrite dired






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 31 '18 at 16:35









devcomdevcom

465




465




migrated from superuser.com Dec 31 '18 at 16:54


This question came from our site for computer enthusiasts and power users.









migrated from superuser.com Dec 31 '18 at 16:54


This question came from our site for computer enthusiasts and power users.















  • If the file already exists in the Dired directory then its date and size are also available there. This might require you to use g to refresh the listing, or ( to unhide details. And it might require you to use search, to get to that file in the listing. If the target directory is not already shown in a Dired buffer then it will require you to visit that directory. And you'll probably need to first quit the copy/move/etc. operation, to check the info, and then relaunch the operation.

    – Drew
    Dec 31 '18 at 19:02











  • You could modify the message and prompt, to add an option to list the file(s) in question, including their details.

    – Drew
    Dec 31 '18 at 19:03



















  • If the file already exists in the Dired directory then its date and size are also available there. This might require you to use g to refresh the listing, or ( to unhide details. And it might require you to use search, to get to that file in the listing. If the target directory is not already shown in a Dired buffer then it will require you to visit that directory. And you'll probably need to first quit the copy/move/etc. operation, to check the info, and then relaunch the operation.

    – Drew
    Dec 31 '18 at 19:02











  • You could modify the message and prompt, to add an option to list the file(s) in question, including their details.

    – Drew
    Dec 31 '18 at 19:03

















If the file already exists in the Dired directory then its date and size are also available there. This might require you to use g to refresh the listing, or ( to unhide details. And it might require you to use search, to get to that file in the listing. If the target directory is not already shown in a Dired buffer then it will require you to visit that directory. And you'll probably need to first quit the copy/move/etc. operation, to check the info, and then relaunch the operation.

– Drew
Dec 31 '18 at 19:02





If the file already exists in the Dired directory then its date and size are also available there. This might require you to use g to refresh the listing, or ( to unhide details. And it might require you to use search, to get to that file in the listing. If the target directory is not already shown in a Dired buffer then it will require you to visit that directory. And you'll probably need to first quit the copy/move/etc. operation, to check the info, and then relaunch the operation.

– Drew
Dec 31 '18 at 19:02













You could modify the message and prompt, to add an option to list the file(s) in question, including their details.

– Drew
Dec 31 '18 at 19:03





You could modify the message and prompt, to add an option to list the file(s) in question, including their details.

– Drew
Dec 31 '18 at 19:03










1 Answer
1






active

oldest

votes


















2














OK, I've just updated Dired+ to help with this.



Now, when you're told there is an overwrite conflict and asked what to do about it, in addition to the standard actions of hitting y, n, q or ! , you can hit l, which pops up a window that lists details about the file(s): last modification time and permissions. Then you can hit one of the other keys with your choice of action.



The library is here: https://www.emacswiki.org/emacs/download/dired%2b.el.






share|improve this answer
























  • This is a most helpful addition to Dired+. Thank you. It does not however solve the problem of disparate file sizes.

    – devcom
    Jan 11 at 7:59






  • 1





    In cases where both source and destination file are available to the calling function, l lists them both. E.g., when dired-get-files calls diredp-y-or-n-files-p to ask "Use marked (instead of all) in subdir Dired buffers?" and you hit l you see the sizes (and permissions) for both files (which solves the size "problem", I think). In some other contexts only the destination file is available to the function that queries you, so l can only list its details. In code you write, you can use diredp-list-files anytime to list details of any set of files.

    – Drew
    Jan 11 at 17:02











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "583"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f46837%2foverwriting-files-in-an-emacs-dired-buffer-using-move-or-copy%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














OK, I've just updated Dired+ to help with this.



Now, when you're told there is an overwrite conflict and asked what to do about it, in addition to the standard actions of hitting y, n, q or ! , you can hit l, which pops up a window that lists details about the file(s): last modification time and permissions. Then you can hit one of the other keys with your choice of action.



The library is here: https://www.emacswiki.org/emacs/download/dired%2b.el.






share|improve this answer
























  • This is a most helpful addition to Dired+. Thank you. It does not however solve the problem of disparate file sizes.

    – devcom
    Jan 11 at 7:59






  • 1





    In cases where both source and destination file are available to the calling function, l lists them both. E.g., when dired-get-files calls diredp-y-or-n-files-p to ask "Use marked (instead of all) in subdir Dired buffers?" and you hit l you see the sizes (and permissions) for both files (which solves the size "problem", I think). In some other contexts only the destination file is available to the function that queries you, so l can only list its details. In code you write, you can use diredp-list-files anytime to list details of any set of files.

    – Drew
    Jan 11 at 17:02
















2














OK, I've just updated Dired+ to help with this.



Now, when you're told there is an overwrite conflict and asked what to do about it, in addition to the standard actions of hitting y, n, q or ! , you can hit l, which pops up a window that lists details about the file(s): last modification time and permissions. Then you can hit one of the other keys with your choice of action.



The library is here: https://www.emacswiki.org/emacs/download/dired%2b.el.






share|improve this answer
























  • This is a most helpful addition to Dired+. Thank you. It does not however solve the problem of disparate file sizes.

    – devcom
    Jan 11 at 7:59






  • 1





    In cases where both source and destination file are available to the calling function, l lists them both. E.g., when dired-get-files calls diredp-y-or-n-files-p to ask "Use marked (instead of all) in subdir Dired buffers?" and you hit l you see the sizes (and permissions) for both files (which solves the size "problem", I think). In some other contexts only the destination file is available to the function that queries you, so l can only list its details. In code you write, you can use diredp-list-files anytime to list details of any set of files.

    – Drew
    Jan 11 at 17:02














2












2








2







OK, I've just updated Dired+ to help with this.



Now, when you're told there is an overwrite conflict and asked what to do about it, in addition to the standard actions of hitting y, n, q or ! , you can hit l, which pops up a window that lists details about the file(s): last modification time and permissions. Then you can hit one of the other keys with your choice of action.



The library is here: https://www.emacswiki.org/emacs/download/dired%2b.el.






share|improve this answer













OK, I've just updated Dired+ to help with this.



Now, when you're told there is an overwrite conflict and asked what to do about it, in addition to the standard actions of hitting y, n, q or ! , you can hit l, which pops up a window that lists details about the file(s): last modification time and permissions. Then you can hit one of the other keys with your choice of action.



The library is here: https://www.emacswiki.org/emacs/download/dired%2b.el.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 2 at 6:04









DrewDrew

47.8k462104




47.8k462104













  • This is a most helpful addition to Dired+. Thank you. It does not however solve the problem of disparate file sizes.

    – devcom
    Jan 11 at 7:59






  • 1





    In cases where both source and destination file are available to the calling function, l lists them both. E.g., when dired-get-files calls diredp-y-or-n-files-p to ask "Use marked (instead of all) in subdir Dired buffers?" and you hit l you see the sizes (and permissions) for both files (which solves the size "problem", I think). In some other contexts only the destination file is available to the function that queries you, so l can only list its details. In code you write, you can use diredp-list-files anytime to list details of any set of files.

    – Drew
    Jan 11 at 17:02



















  • This is a most helpful addition to Dired+. Thank you. It does not however solve the problem of disparate file sizes.

    – devcom
    Jan 11 at 7:59






  • 1





    In cases where both source and destination file are available to the calling function, l lists them both. E.g., when dired-get-files calls diredp-y-or-n-files-p to ask "Use marked (instead of all) in subdir Dired buffers?" and you hit l you see the sizes (and permissions) for both files (which solves the size "problem", I think). In some other contexts only the destination file is available to the function that queries you, so l can only list its details. In code you write, you can use diredp-list-files anytime to list details of any set of files.

    – Drew
    Jan 11 at 17:02

















This is a most helpful addition to Dired+. Thank you. It does not however solve the problem of disparate file sizes.

– devcom
Jan 11 at 7:59





This is a most helpful addition to Dired+. Thank you. It does not however solve the problem of disparate file sizes.

– devcom
Jan 11 at 7:59




1




1





In cases where both source and destination file are available to the calling function, l lists them both. E.g., when dired-get-files calls diredp-y-or-n-files-p to ask "Use marked (instead of all) in subdir Dired buffers?" and you hit l you see the sizes (and permissions) for both files (which solves the size "problem", I think). In some other contexts only the destination file is available to the function that queries you, so l can only list its details. In code you write, you can use diredp-list-files anytime to list details of any set of files.

– Drew
Jan 11 at 17:02





In cases where both source and destination file are available to the calling function, l lists them both. E.g., when dired-get-files calls diredp-y-or-n-files-p to ask "Use marked (instead of all) in subdir Dired buffers?" and you hit l you see the sizes (and permissions) for both files (which solves the size "problem", I think). In some other contexts only the destination file is available to the function that queries you, so l can only list its details. In code you write, you can use diredp-list-files anytime to list details of any set of files.

– Drew
Jan 11 at 17:02


















draft saved

draft discarded




















































Thanks for contributing an answer to Emacs Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f46837%2foverwriting-files-in-an-emacs-dired-buffer-using-move-or-copy%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?