-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msgconvert ignores subdirectory in file path #68
Comments
@dingens try this (generated by GPT...) #!/bin/bash
# Define a recursive function to process directories
process_directory() {
local dir="$1" # Local variable to store the directory path
pushd "$dir" > /dev/null # Change directory and suppress output
# Find and convert .msg files in the current directory
if [[ -n $(find . -maxdepth 1 -name "*.msg") ]]; then
msgconvert *.msg # Convert .msg files
echo "Processed directory: $dir" # Display the directory processed
else
echo "Directory: $dir has no .msg files" # Display no .msg files were found.
fi
# Recursively process subdirectories
for subdir in */; do
if [[ -d "$subdir" ]]; then
process_directory "$subdir" # Recursive call for subdirectories
fi
done
popd > /dev/null # Return to the previous directory and suppress output
}
# Start processing from the current directory
process_directory "." # Start the recursive process
echo "Processing complete." # Display completion message |
@sandbro please don't post untested GPT output. |
Hi @mvz, I tried this Bash command on my computer, and it works. |
@sandbro I appreciate your intention to help, however I think that this is a bug in msgconvert that should be fixed (or, at least, it's unexpected behavior that should be documented). Your script does not solve this. If however somebody urgently needs a workaround, they could just use find's
|
When calling
msgconvert dir/mail.msg
, output is written to./mail.eml
, instead of the expecteddir/mail.msg
. (Same with absolute paths:msgconvert /some/where/mail.msg
also createsmail.eml
in the current working directory.)The behavior of overriding existing files (which is documented) in combination with this (not documented) can result in data loss even when people are aware of the "normal" overriding, because one would not reasonably expect that files in the current working directory might be overridden as well.
Bug observed in 0.921, but I could not find a matching commit since, so I strongly assume it is still present.
The text was updated successfully, but these errors were encountered: