Comments (13)
Sorry: this was the original code...
print(doc, target = "output/demo-Werkgelukmeter.docx")
from officer.
Could you confirm you can write any other file?
from officer.
I can confirm that I can output other files (.png from GGPlot) to that same directory called 'output' (right under the directory that holds the script).
from officer.
Can you try cat("", file = "output/demo-Werkgelukmeter.txt")
from officer.
Yes, I did. It creates demo-Werkgelukmeter.txt in output. File length = 0.
from officer.
and can you try that:
pack_folder("output", "test.zip")
from officer.
I got that in zip package source:
https://github.com/gaborcsardi/zip/blob/master/src/rzip.c#L21
I don't think it's about officer but with your settings.
from officer.
I gues that you are right, because:
[Tue May 30 16:43:25.839819 2017] [:error] [pid 11318] [client 213.127.237.217:57762] rApache Notice!
Loading required package: officer
Loading required package: magrittr
Loading required package: xlsx
Loading required package: rJava
Loading required package: xlsxjars
Loading required package: limer
Loading required package: ggplot2
Loading required package: mailR
Loading required package: flextable
Saving 178 x 178 mm image
Error in value[3L] :
Could not write '/home/tammo/domains/pcx2tammo.toolsforresearch.com/public_html/project/gw/test.zip' [Can't create zip file entry]
Traceback:
9: stop("Could not write ", shQuote(target), " [", e$message, "]")
8: value[3L]
7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
6: tryCatchList(expr, classes, parentenv, handlers)
5: tryCatch(zip(zipfile = target, files = list.files(all.files = TRUE,
recursive = TRUE)), error = function(e) {
stop("Could not write ", shQuote(target), " [", e$message,
"]")
}, finally = {
setwd(curr_wd)
})
4: pack_folder("output", "test.zip")
3: eval(expr, envir, enclos)
2: eval(exprs[i], envir)
1: sys.source(file = "/home/tammo/domains/pcx2tammo.toolsforresearch.com/private_html/project/gw/wgofficer.R",
envir = .rAenv)
from officer.
Thank you very much for helping me trouble shoot this! I will go on..
from officer.
Hi David,
I don't think it's about officer but with your settings.
Tammo's business-partner here. I had a hard time troubleshooting this one. I first made sure everything was running with the same user:group. That took some juggling with mod_ruid2.so (under Directadmin).
But even then we were running into the same error. It worked in RStudio, it worked in plain R, but it failed in (R)Apache. A PHP-script running on the same spot with the same user:group did not fail.
In the end I removed the call to the zip package and replaced it with a crude system call to /usr/bin/zip. The change is here: toolsforresearch@3e2c49e
For the moment this is working in our case. Tammo switched back from ReporteRs (which had no problems with creating a zip- or docx-file) to toolsforresearch/officer
from officer.
Tammo did an upgrade by using
devtools::install_github("davidgohel/officer")
and stumbled into the same error.
So I had to fix it once again:
devtools::install_github("toolsforresearch/officer")
Please review #36
from officer.
Seriously?
OK, glad we can use that tone! It sometimes difficult to answer politely.
I could not reproduce the problem. I used opencpu that is using rapache and no issue occured. That's why I did not comment, your issue is not reproducible for now.
I had to fix it again
From my point of view, I have to take free time again to try to solve your specific issue that is not reproducible. Also, why spending time on officer
while your issue is with function zip
which is not in officer package. You could instead fix the zip package?
Please review and merge this PR or find a more suitable solution.
The PR you submited is only working on your system and will break many other systems - what do you propose to solve the issue you are introducing for Window/linux/mac users that don't have program zip in their path? Of I see "merge or find a more suitable solution"... smart, very smart!
Please, if you want to submit a PR, be sure:
- it will not break anything
- it does not reverse something that has already be changed (I guess you did not ask yourself the question why the zip package was used instead of zip function of R)
- do not be gross and do not give order to people that work for you for free
To reproduce the issue, I will have to create a new Linux machine, learn about rapache and test officer in it. As I can only work on that during free time and as there is no contract between us, you will have to wait.
from officer.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
from officer.
Related Issues (20)
- docx_summary() function doesn't work after caption insertion HOT 1
- body_add_docx() doesn't work if file path for src contains & HOT 2
- `fp_text_lite()` doesn't work with `shading.color` HOT 1
- `cursor_bookmark` is no longer working as expected for inserting text in tables HOT 10
- PPTX get_shape_id identifying wrong ID HOT 3
- docx_comments bugs HOT 2
- Have body_replace_img_at_bkm use image size in document, not from external_img HOT 3
- Quarto rendering problem due to check of `tbl-cap` as cell option HOT 3
- Style = "centered" not supported anymore, was it removed? HOT 3
- Trying to follow solution from #484 but get Error: $ operator is invalid for atomic vectors
- Saving files fails if officer is installed read-only HOT 5
- Installation fails: Error in parse(outFile) : {INSTALL_DIR}/officer/R/docx_comments.R:52:44: unexpected input
- Read_docx does not respect embedded fonts HOT 3
- Saving pptx files fails if officer is installed read-only HOT 5
- `ph_with.gg` does not add an `alt_text=` to pptx HOT 1
- body_add_docx workaround for fast generation of large documents doesn't work anymore HOT 2
- It is hoped that `block_pour_docx()` can work in bookdown::word_document2 HOT 4
- how to add hyperlink for embedded image in PPT. HOT 1
- remove_slide doesn't remove images from ppt/media HOT 4
- Add comment to an existing paragraph HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from officer.