Copying Files from Package Files

Discussion in 'Mac Programming' started by Tomar, Mar 18, 2014.

  1. Tomar macrumors member

    Joined:
    May 21, 2008
    #1
    Hello

    I'm trying to copy a file with a specific extension out of a package file and into another directory.

    I used the following in terminal:

    cp filename.package/*.txt .

    I keep getting the following error:

    cp: filename.package/*.txt: No such file or directory

    What am I doing wrong???
     
  2. Terminated macrumors newbie

    Joined:
    Mar 18, 2014
    #2
    I can think of two possibilities:

    1) It may be that filename.package is not in the current working directory.

    2) Or it may be that there is no file with extension .txt in the first level of the directory filename.package.

    Both situations would cause the same error message.
     
  3. Tomar thread starter macrumors member

    Joined:
    May 21, 2008
    #3
    I can copy the file using the aforementioned command if specify the filename

    cp filename.package/textfilename.txt .

    However, it doesn't seem to work when I try to use the wildcard

    cp filename.package/*.txt .

    The name of the text file changes when a new package file which is why I'm trying to copy it using a wildcard and the file extension
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    Post the output of this command line:
    Code:
    ls -ld filename.package ; ls -la filename.package ; id
    
    Copy and paste the exact command-line into Terminal. Copy and paste the complete unchanged output into a reply here, including any error messages that may appear.
     

Share This Page