OS X에서 심볼릭 링크가있는 zip을 복사하는 방법은 무엇입니까? 다른 하위

심볼릭 링크가있는 zip 파일을 만들려고합니다.
내 메인 폴더에 서브 폴더가 있습니다. 번들. 메인 폴더의 다른 하위 폴더에있는이 some.bundle에 대한 심볼릭 링크를 만듭니다.
터미널을 사용하여 압축합니다.

내 문제는 터미널을 통해 zip을 연 다음 심볼릭 링크를 사용하여 번들을 다른 폴더로 복사하려고 할 때입니다. 그것은 작동하지 않습니다.

그것은 다음과 같은 오류를 준다.

cp:/path to my subfolder with bundle symbolic link/some.bundle No such file or directory



답변

나는이 문제를 확인 / 해결하기 위해 다음과 같이했다. (그러나 질문 / 문제를 정확하게 이해할 수 있을지 모르겠다.)

enter image description here

  1. 다음과 함께 file.bundle 만들기

    touch /Users/user/temp/step1/file.bundle
    
  2. 다른 폴더에 심볼릭 링크 만들기

    ln -s /Users/user/temp/step1/file.bundle /Users/user/temp/step2/
    

    심볼릭 링크의 (다시 기록 된) 16 진수 내용은 다음과 같습니다.

    /Users/user/temp/step1/file.bundle
    
  3. 심볼릭 링크를 압축하십시오.

    zip -y /Users/user/temp/step3file.bundle.zip /Users/user/temp/step2/file.bundle`
    
  4. 폴더를 생성하고 (step4) cd를 입력 한 후 step3file.bundle.zip의 압축을 풉니 다.

    mkdir /Users/user/temp/step4
    cd /Users/user/temp/step4
    unzip /Users/user/temp/step3file.bundle.zip
    

    / Users / user / temp / step4 / Users / user / temp / step2에있는 압축 해제 된 symlink의 (다시 기록 된) 16 진수 내용은 여전히 ​​유지됩니다.

    /Users/user/temp/step1/file.bundle
    
  5. 폴더 step4의 하위 폴더에있는 symlink를 사용하여 폴더 step5의 file.bundle을 복사합니다.

    cd /Users/user/temp/step4/Users/user/temp/step2
    cp file.bundle /Users/user/temp/step5
    

위의 단계가 작동합니다. symlink가 포함 된 폴더를 압축하거나 일부 경로 / 명령 (및 일부 옵션)이 잘못되었을 수 있습니다.


답변