ios - Deb fails to install if space is in file name -


so in app have table view. if file deb, asks install, press install , takes me view controller shows install, similar ifile , cydia (not glamorous output lol).

all fine in aspect. installs. however. if file has space in name, i.e. random file.deb, fails. noticed ifile has figured out, tried contacting them see if enlighten me on situation, no response yet.

how escape space? or make seem dpkg doesn't care it's there?

this how call , execute install.

mydownloadsviewcontroller * vc = [[mydownloadsviewcontroller alloc] init]; vc.filename = debname;  // documents folder nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); path = [paths objectatindex:0]; path = [[@"~/documents/myfolder" stringbyexpandingtildeinpath] retain];  nsstring *debpath = [path stringbyappendingpathcomponent:vc.filename];  //nstask     nstask *task = [[nstask alloc] init]; nspipe *pipe = [nspipe pipe]; [task setlaunchpath: mylaunchpath]; [task setarguments: [nsarray arraywithobjects:@"/usr/bin/dpkg", @"-i", debpath, @"2>/tmp/dpkg.log" ,nil]]; [task setstandardoutput: pipe]; [task launch]; 

i've tried using:

[filename stringbyreplacingoccurrencesofstring:@" " withstring:@""] 

in both downloads send file , in output view controller receive it. either fails or app crashes.

i've tried:

if ( [filename rangeofstring:@" "].location != nsnotfound ) {     appendedfile = [path stringbyreplacingoccurrencesofstring:@" " withstring:@""];         } 

to determine file has space, if not proceed normal. had unwanted results in same fashion, plus install whatever last deb in table view was.

would better use 2 nstasks. 1 unpack , 2nd configure? ive tried wouldn't go onto second task, or still see first 1 running , lock dpkg.

any insight or knowledge appreciated.

you're executing command line app, have execute if typing @ shell prompt yourself.

this installs package named file named foo, , passes weird/unknown argument bar.deb dpkg

/usr/bin/dpkg -i foo bar.deb 

this installs package file named 'foo bar.deb'

/usr/bin/dpkg -i "foo bar.deb" 

note quotes... use \ escape space, have realize have double escape: once obj-c, , ones shell.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -