Error copying directory from to

Issue with docker cp on windows when copying directory content to an existing directory #34638

Comments

Description
According to official docker documentation, docker cp src_path dest_path should support the following behavior: When src_path specifies and directory and ends with /. (for windows, \. ), and the dest_path specifies an existing directory, the content of src_path (files and sub-directories) should be copied into dest_path . However, docker on windows gives an error instead in this case.

Steps to reproduce the issue:

  1. On host machine: docker run -it —name test_container microsoft/nanoserver
  2. Within the launched container: Create the the following directory and file C:\test_dir\test.txt , and then exit the container
  3. On host machine: mkdir docker_test
  4. On host machine: docker cp test_container:C:\test_dir\. .\docker_test

Describe the results you received:

Describe the results you expected:
test.txt file should appear in .\docker_test on host machine

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version :

Output of docker info :

Additional information:
I have also tried with various other kinds of src_path endings, including \ , \* . None of them can correctly produce the behavior of copying content of a container directory (not the directory itself) to an existing host directory.
This issue is filed after discussion with @jhowardmsft.
@darrenstahlmsft @johnstep

The text was updated successfully, but these errors were encountered:

Источник

«No such file or directory» error when attempting to copy (using scp) from remote host to local machine

I am attempting to copy a file (/home4/user/public_html/website.com/folder_1/folder_2/file_to_copy.zip) from my remote host to my local machine’s desktop (/Users/username/Desktop) using the scp command.

In order to accomplish this I run iTerm on my Mac and use the following command:

(It might also be worth noting that I am logged in via ssh to my remote host as I try to execute this command.)

When I run the command I am prompted to fill in the password for user@remotehost.com (which I do) and then I receive the following error message:

/Users/username/Desktop: No such file or directory

Similarly, I have been unable to use scp to copy files to my remote host.

Any help with this issue is highly appreciated, and I hope that I can receive simple/thorough explanations as I am completely new to using a command line and ssh.

1 Answer 1

scp does not require that you SSH to the remote computer in order to make the copy (and this is where you’re currently running into trouble with your command).

scp essentially works in either a push or pull fashion. You can push files/folders from your local PC to a remote. The command syntax for this method is as follows:

Which will prompt you for the password of user on remotehost .

You can also pull file/folders from a remote PC to your local PC. The command syntax for this method is as follows:

Which will also prompt you for the password to user on remotehost .

The problem you were running into with your command above is that you were using the data pull syntax of the scp command in order to grab a file from a remotehost, but you were also SSH’d into that remotehost while running it.

Читайте также:  Vapor storm 80w прошивка

The correct way to run this command is to run it from your local machine

**Note that I removed the superfluous -r from your original command. It’s not something that will throw off an error, but it’s just that it’s not necessary in your case. The -r option of scp is to be used when recursively copying a folder and all its contents. In your case you were just copying a file so it wasn’t necessary.

**I also added the -P 2222 since subsequent comments from you indicated that you needed to use port 2222 instead of standard port 22.

Источник

«No such file or directory» error when attempting to copy (using scp) from remote host to local machine

I am attempting to copy a file (/home4/user/public_html/website.com/folder_1/folder_2/file_to_copy.zip) from my remote host to my local machine’s desktop (/Users/username/Desktop) using the scp command.

In order to accomplish this I run iTerm on my Mac and use the following command:

(It might also be worth noting that I am logged in via ssh to my remote host as I try to execute this command.)

When I run the command I am prompted to fill in the password for user@remotehost.com (which I do) and then I receive the following error message:

/Users/username/Desktop: No such file or directory

Similarly, I have been unable to use scp to copy files to my remote host.

Any help with this issue is highly appreciated, and I hope that I can receive simple/thorough explanations as I am completely new to using a command line and ssh.

1 Answer 1

scp does not require that you SSH to the remote computer in order to make the copy (and this is where you’re currently running into trouble with your command).

scp essentially works in either a push or pull fashion. You can push files/folders from your local PC to a remote. The command syntax for this method is as follows:

Which will prompt you for the password of user on remotehost .

You can also pull file/folders from a remote PC to your local PC. The command syntax for this method is as follows:

Which will also prompt you for the password to user on remotehost .

The problem you were running into with your command above is that you were using the data pull syntax of the scp command in order to grab a file from a remotehost, but you were also SSH’d into that remotehost while running it.

The correct way to run this command is to run it from your local machine

**Note that I removed the superfluous -r from your original command. It’s not something that will throw off an error, but it’s just that it’s not necessary in your case. The -r option of scp is to be used when recursively copying a folder and all its contents. In your case you were just copying a file so it wasn’t necessary.

**I also added the -P 2222 since subsequent comments from you indicated that you needed to use port 2222 instead of standard port 22.

Источник

copy directory tar.gz file from root to external hard disk error

I am able to login to root terminal and then create tar zip file by running the command tar -zcvf dspace_tar.gz /home/dspace in a root terminal.

Читайте также:  Yealink sip t31 прошивка

But I am not able to copy using the command

which is my external hard disk.

I get two errors: stat error and no such file or root directory.

3 Answers 3

Do not try to write to a device file ( /dev/sdxY ) — you should write to the mount point ( /media/username/drive_name )

Since your trying to copy as root you should be doing:

If you don’t know the mount point of the device, first plug it in then do this to get the address:

  • -f option provided more information about the filesystems.
  • -a : used when copying archives
  • -v : displays the process in the terminal

the command «man cp» states that cp copies files and directories. This is a file system based operation. You try to copy a file direct — without using a file system — so a device (/dev/sdb1). Here are some options to meet your needs:

there are also other options, but I think this are the 2 major ways. Usual way is to use a file system on a disk device.

You are trying to overwrite your hard drive. I frequently use similar commands to write images.

If your hard drive is mounted somewhere try copying your file to the mount point. To do that run the command lsblk and look at the right side of the output.

If it isn’t mounted you will have to mount it by first creating a directory for the mount point, then running sudo mount /dev/sdb1

. (Replace with the path to your folder). Then you can copy the file onto the hard drive, which appears as the folder.

Источник

brut.directory.DirectoryException: Error copying file: ♂ ? .xml #1129

Comments

Apktool version: 2.0.3
Sample.apk is obfuscated by Dexguard and multidex enabled.

Error output while decompiling (source or resource only doesn’t make any difference)

The text was updated successfully, but these errors were encountered:

so, is it decrypted?

I have the same problem but only on Windows system. On Linux works perfect.
This file
https://drive.google.com/file/d/0B0hFfYwwa3TfR051bXFkVWFsbE0/view?usp=sharing
apktool is decoded with no issues on Ubuntu.

People are mixing issues here. One is that dexguard introduces non-standard characters into XML files that stock aapt cannot handle, thus crash.

There is a separate issue where host computers don’t have the proper charsets to support UTF8 characters, thus errors.

The second issue is not apktool’s fault. Granted, either is the first one, but apktool embeds aapt so we must find the patch in that.

I got the same error yesterday when I tried to use apktool 2.1.1 to decompile an apk file.

The file path is . \assets\atlas\3_5\480×800\spine\general\coin-big.atlas and I didn’t see special character in coin-big.atlas.

@zachary-jomedia can you open a new bug with that apk attached and reference this issue? That seems to be a bug unrelated to Dexguard.

i need help with

This was fixed with the recent patches to aapt. Will be in the 2.2.2 release.

Please help me,
I have face the same issue also in the apktool version 2.2.2.

C:\Windows>apktool d ab.apk
I: Using Apktool 2.2.2 on ab.apk
I: Loading resource table.
Exception in thread «main» brut.androlib.AndrolibException: brut.directory.DirectoryException: file must be a directory: ab
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:225)
at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:136)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:106)
at brut.apktool.Main.cmdDecode(Main.java:166)
at brut.apktool.Main.main(Main.java:81)
Caused by: brut.directory.DirectoryException: file must be a directory: app-release
at brut.directory.FileDirectory.(FileDirectory.java:38)
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:205)
. 4 more

@kirit12 This is not the same issue. You don’t have permission to create the folder app-release . Apktool by default decodes from app-release.apk to app-release folder. You can override this folder by using -o folder .

Читайте также:  Connection read error occurred

thanks for the answer. Actually, my computer has no permission to create any folder in C:\windows\ directory. so I just put into the other directory and then now it’s work fine.
Thank you again.

Seems same exception on windows with apktool-2.2.3:

the problem was resolved?! 🙁

It occurs on Windows boxes only. On my Linux box works okay.

I hade the same prbolem with 2.3.1 version :

Exception in thread «main» brut.androlib.AndrolibException: brut.directory.DirectoryException: file must be a directory: app-debug at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:227) at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:137) at brut.androlib.ApkDecoder.decode(ApkDecoder.java:122) at brut.apktool.Main.cmdDecode(Main.java:163) at brut.apktool.Main.main(Main.java:72) Caused by: brut.directory.DirectoryException: file must be a directory: app-debug at brut.directory.FileDirectory. (FileDirectory.java:38) at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:207) . 4 more
i put jar file at /usr/local/bin/ as structure Install Instructions.

As i run jar file with root privilege , problem solved and deCompile folder created at /usr/local/bin//
or you can locate jar file at apk path and run it with relative path

as @iBotPeaches commented the problem was for creating the result folder

I solved my problem by copying apktool.jar and apktool.bat to another directory except Windows folder
I had same issue with Mac and Windows

I: Using Apktool 2.3.2
brut.directory.DirectoryException: java.io.FileNotFoundException: build (ϵͳ�Ҳ���ָ�����ļ���)

Please help me, I rebuild apk from a folder and the folder is exist, I am sure the folder exist and can read & write , but i have this issue
In window:
apktool build C:\Users\xxx\desktop\ApktoolDex\apktool2.3.2\xxxx -o C:\Users\xxx\desktop\ApktoolDex\apktool2.3.2\xxxx.apk

The xxxx folder is decod xxxx.apk folder, then i want rebuild back, but failure

Firstly I used mac for recompiling, I solved filenotfound error just removing tilda sign infront of path. I explicitly wrote java -jar apktool.jar b path to decompiledFolder -o nameofoutput.apk

i facing this issue while decompiling

I: Using Apktool 2.4.0 on package.apk
I: Copying raw resources.
Exception in thread «main» brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: res
at brut.androlib.Androlib.decodeResourcesRaw(Androlib.java:125)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:106)
at brut.apktool.Main.cmdDecode(Main.java:167)
at brut.apktool.Main.main(Main.java:76)
Caused by: brut.directory.DirectoryException: Error copying file: res
at brut.directory.DirUtil.copyToDir(DirUtil.java:91)
at brut.directory.DirUtil.copyToDir(DirUtil.java:68)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:203)
at brut.androlib.Androlib.decodeResourcesRaw(Androlib.java:123)
. 3 more
Caused by: brut.directory.DirectoryException: Error copying file: ? ?.xml
at brut.directory.DirUtil.copyToDir(DirUtil.java:88)
at brut.directory.DirUtil.copyToDir(DirUtil.java:61)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:198)
at brut.directory.DirUtil.copyToDir(DirUtil.java:77)
. 6 more
Caused by: java.io.FileNotFoundException: package\res? ?.xml (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at brut.directory.DirUtil.copyToDir(DirUtil.java:84)
. 9 more

I have similar error

AMAC02XF2Q3JG5J:Downloads abcuser$ apktool d -f -r 9.4.0(4)-google-release-protected.apk
I: Using Apktool 2.4.1 on 9.4.0(4)-google-release-protected.apk
I: Copying raw resources.
I: Baksmaling classes.dex.
I: Baksmaling classes2.dex.
I: Baksmaling classes3.dex.
I: Copying assets and libs.
I: Copying unknown files.
Exception in thread «main» brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: tV
at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:214)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:180)
at brut.apktool.Main.cmdDecode(Main.java:170)
at brut.apktool.Main.main(Main.java:76)
Caused by: brut.directory.DirectoryException: Error copying file: tV
at brut.directory.DirUtil.copyToDir(DirUtil.java:91)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:208)
at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:207)
. 3 more
Caused by: java.io.FileNotFoundException: 9.4.0(4)-google-release-protected/unknown/tv (Is a directory)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:237)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:187)
at brut.directory.DirUtil.copyToDir(DirUtil.java:87)
. 5 more

/usr/local/bin/apktool: line 1: @echo: command not found
/usr/local/bin/apktool: line 2: setlocal: command not found
/usr/local/bin/apktool: line 8: syntax error near unexpected token (‘ /usr/local/bin/apktool: line 8: if defined JAVA_HOME (‘

@coderhariexpert — you must be mixing windows/unix somehow. You have the path of a common Linux machine, with the Windows helper script. Either way, this is not the place for support on an unrelated issue.

@coderhariexpert on what machine you are running ?

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Smartadm.ru
Adblock
detector