If you get lost in path land you can always take a break and use the
/full/path/to/docsplit.
On Feb 9, 2014, at 2:03 AM, CW Alston cwalsto...@gmail.com wrote:
Ah! Thanks, Joe-
Great tip; should clear up the issue with which. I am indeed starting
Factor in the Finder. I'll try adjusting
Hi John-
Beg pardon, I should have mentioned earlier that since docsplit plants a
.txt file in the target pdf's
directory on its own, with no other output, I had gone the route you
suggested, but to no avail, i.e.,
docsplit text --no-clean -l path run-process drop
In the terminal, cd
It's probably easiest to specify the full path to the file, like I did
in my previous message. Combined with the full path to the docsplit
binary/link (for your particular problem), it should theoretically
work fine:
/full/path/to/docsplit text --no-clean -l chi_sim
As a follow-up, from Factor you can use `with-directory-files`
(http://docs.factorcode.org/content/word-with-directory-files,io.directories.html)
and `absolute-path`
(http://docs.factorcode.org/content/word-absolute-path,io.pathnames.html)
to get full paths to the files in some directory:
```
IN:
Hi Alex-
Thanks, I did try
/full/path/to/docsplit text --no-clean -l chi_sim
/path/to/1_long_gu/long_gu001.pdf try-process
using both the symlink and the resolved executable:
/usr/local/opt/ruby/bin/docsplit
/usr/local/Cellar/ruby/2.1.0/bin/docsplit
but still no response, still status 0. A
Strange. Well, not actually strange, since many programs aren't great
about return codes...but still! I decided to re-enact the issue by
removing /usr/local/bin (where my docsplit was installed) from my PATH,
starting Factor, and trying it out. Looks like docsplit is dumping the txt
file in the
Yeah, Alex-
I would have thought the cd in my compound command string would take care
of he current directory issue.
There's another thread about this
problemhttp://www.programmingrelief.com/3213645/Docsplit-Works-Fine-In-Command-Line-But-Ignores-Code-In-Ruby-Script%3Fthat
finds docsplit returning
Thing is, `cd` isn't a binary that Factor can execute in a process. It's
just a shell command implemented by bash or zsh or whatever you use. Same
with the semicolon syntax, for that matter. You might try to finagle
something like
IN: scratchpad { sh -c cd /tmp ; pwd } utf8 [ contents . ]
Lord love a duck, Alex - I didn't realize that builtins like `cd` are
'existentially' different than utilities like `cat` -
(I only speak pidgin unix; bites me often). Thanks for the heads-up.
Okay... I'll try moving|copying my target directory into my home folder, to
obviate the need for any
I can't tell you what's wrong with code you haven't provided, but...
```
IN: scratchpad USING: io.files io.launcher io.encodings.ascii tools.which ;
IN: scratchpad docsplit which .
/usr/local/bin/docsplit
IN: scratchpad /tmp/cv.pdf exists? .
t
IN: scratchpad /tmp/cv.txt exists? .
f
IN: scratchpad
Well if you want process output, you can do something like:
{ docsplit text --no-clean -l path } utf8 [ lines ]
with-process-reader
or without output, using a single command string:
docsplit text --no-clean -l path run-process drop
You can docsplit a directory of files:
: docsplit
Thanks for the replies. Maybe a clue here - I get this from which:
IN: scratchpad USE: tools.which
IN: scratchpad docsplit which .
f
IN: scratchpad couchdb which .
f
IN: scratchpad ruby which .
f
Whereas in the terminal:
➜ ~ git:(master) ✗ which docsplit
/usr/local/opt/ruby/bin/docsplit
➜ ~
Thats odd, Factor's which just looks in the $PATH for your executable.
IN: scratchpad PATH os-env
You can read a bit about how its implemented cross-platform:
http://re-factor.blogspot.com/2013/01/which.html
On Sat, Feb 8, 2014 at 2:30 PM, CW Alston cwalsto...@gmail.com wrote:
Hi -
Ok, I've upgraded using factor-macosx-x86-32-2013-07-25-14-21.dmg,
still Version 0.97. Same issue with Factor's which:
IN: scratchpad USE: tools.which
IN: scratchpad couchdb which .
f
IN: scratchpad python which .
/usr/bin/python
- The trouble appears to be with reporting my PATH properly,
On Sat, Feb 8, 2014 at 7:30 PM, CW Alston cwalsto...@gmail.com wrote:
Hi -
Ok, I've upgraded using factor-macosx-x86-32-2013-07-25-14-21.dmg,
still Version 0.97. Same issue with Factor's which:
IN: scratchpad USE: tools.which
IN: scratchpad couchdb which .
f
IN: scratchpad python which .
15 matches
Mail list logo