Create Zip File: Error Running Command " " Had Status 127

R build package fails on zip

The best answer I found was adding '--preclean' to the build arguments.

>devtools::build(binary = TRUE,path=".", args = c('--preclean'))

According to the documentation this only cleans the files from a previous build, but it does solve the error message.

Why do I get a system status error of 127 when I run wget in R?

You're using Windows. wget is a Unix/Linux program. You can just call download.file to download from within R:

download.file("ftp://ftp.ncdc.noaa.gov/pub/data/noaa/2016/999999-54856-2016.gz",
"999999-54856-2016.gz", mode="wb")

The mode="wb" is important for downloading binary files on Windows.

Zipping a file using R

Note: This is more of a comment, but I don't have enough rep to do that.

Did you type in install.packages("rtools")? I ask because your warning says rtools. If that is the case try install.packages("Rtools"). Not capitalizing the R makes a difference in R.
Unfortunately I'm not at my computer so I can't test this. If this doesn't work let me know and I'll update my answer.

EDIT: After some more research it looks like install.packages() doesn't work for Rtools. You have to manually download it from online. Here's a link to an Rtools wiki on github that tells you how to download Rtools: https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows

Exec command returns 127 error code

The problem is that the maximum length of a command line is 65535 bytes. I don't know why your command line test worked, maybe you've tried it with short filenames but one full command cannot exceed this limit.

The reason I found your question is because I was calling a command line with a heredoc as standard input, and well, the length of a heredoc can easily run away so I rewrote the call using popen() but that doesn't help you. I haven't worked with the zip utility yet, but a quick look at it's manpage says it appends files to existing archives so you should be able to split your command lines after every 64k if you want max efficiency, or after every 100 or even every single file if you want a simple algorithm.

Make Error 127 when running trying to compile code

Error 127 means one of two things:

  1. file not found: the path you're using is incorrect. double check that the program is actually in your $PATH, or in this case, the relative path is correct -- remember that the current working directory for a random terminal might not be the same for the IDE you're using. it might be better to just use an absolute path instead.
  2. ldso is not found: you're using a pre-compiled binary and it wants an interpreter that isn't on your system. maybe you're using an x86_64 (64-bit) distro, but the prebuilt is for x86 (32-bit). you can determine whether this is the answer by opening a terminal and attempting to execute it directly. or by running file -L on /bin/sh (to get your default/native format) and on the compiler itself (to see what format it is).

if the problem is (2), then you can solve it in a few diff ways:

  1. get a better binary. talk to the vendor that gave you the toolchain and ask them for one that doesn't suck.
  2. see if your distro can install the multilib set of files. most x86_64 64-bit distros allow you to install x86 32-bit libraries in parallel.
  3. build your own cross-compiler using something like crosstool-ng.
  4. you could switch between an x86_64 & x86 install, but that seems a bit drastic ;).


Related Topics



Leave a reply



Submit