• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTask problems with the path - The Code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask problems with the path - The Code


  • Subject: Re: NSTask problems with the path - The Code
  • From: April Gendill <email@hidden>
  • Date: Sat, 22 May 2004 11:35:43 -0700

Here is the code :

NSString * arcName = [NSString
stringWithFormat:@"%@.tgz",[panel filename]];
NSString * origName = [NSString
stringWithFormat:@"%@",[path lastPathComponent]];
NSArray * tmp = [NSArray
arrayWithObjects:@"-c",@"-f",arcName,origName,nil];
[self compressTask:@"/usr/bin/tar" withArguments:tmp
atPath:[panel filename]];

------ above sets up the arguments below is the actual task

[compress setLaunchPath:toolPath];
[compress setArguments:arguments];
[compress setEnvironment:environment];
[compress setStandardOutput:outputPipe];
[compress setStandardError:errorPipe];
[compress setCurrentDirectoryPath:fullPath];
[compress launch];
[compress waitUntilExit];


so I don't know what I'm doing wrong. I've tried both the NSTask set
directory and the NSFileManager one but neither helps

On May 22, 2004, at 4:24 AM, Pontus Ilbring wrote:

> On 2004-05-22, at 08.04, April Gendill wrote:
>
>> Ok, I'm trying to add a minor feature to an application, and to avoid
>> ripping my hair out trying to learn the gzip lib, I decided to try
>> nstask.of course first I have to tar folders so that they can be
>> gzipped. I'm stuck at tar right now. When I tar a folder and then
>> un-tar the folder I end up with a hierarchy of folders that mimics
>> the directory path to the original. now in the terminal if I cd to a
>> directory then tar something in it, I do not have this problem. I
>> have tried to use the nstask setdirectory call but that does nothing,
>> so my question is: Am I going to have to fudge this and run tcsh then
>> write the commands to it or is there a real way to get the directory
>> to set correctly?
>
> I can't tell what you're doing wrong without looking at the code, but
> I can guess. It sounds like you -do- set the working directory
> correctly, but then pass the files to the tar program by absolute path
> rather than by just filename.
> _______________________________________________
> cocoa-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >NSTask problems with the path (From: April Gendill <email@hidden>)
 >Re: NSTask problems with the path (From: Pontus Ilbring <email@hidden>)

  • Prev by Date: Re: Export panel like iPhoto (Solved)
  • Next by Date: Re: Variable argument lists
  • Previous by thread: Re: NSTask problems with the path
  • Next by thread: Variable argument lists
  • Index(es):
    • Date
    • Thread