Page 2 of 2

Windows command line

Posted: Tue Aug 28, 2007 1:56 pm
by andrewborrell
Hey, did anybody make any progress on command line version for windows. I'd really like to be able to render batches of .cfdg files to pngs.

I am prepared to try cygwin, but thought I'd check noone else had made any progress first.

Posted: Sun Sep 02, 2007 7:07 pm
by MtnViewJohn
I'm trying this again but there are a few Posix components that are not present in Windows: signals/setitimer, getopt, and libpng (very easily). There are some easy-to-use timer functions, but they are not present in Win98/Win ME. Switching from libpng to GDI+ for generating the PNG file is not too hard, the code already exists elsewhere in Context Free. And I found a decent command line parser class.

HELP!!

Posted: Mon Sep 10, 2007 4:42 pm
by grabkate
I'm trying to run a program written in java using cygwin.
How exactly do you use the command line to execute the program.
When i type "./cfdg" it comes up with this error: "cannot execute binary file"
At the moment my program reads in from a .cfdg template and is trying to convert it to .png unfortunately it works perfectly on a mac but i'm not sure what I have to change to get it to work using cygwin.

Posted: Tue Sep 11, 2007 11:08 am
by MtnViewJohn
What happens when you type 'file cfdg'? This could be due to bad blocks on your hard disk or maybe your compiler is setup to target a different architecture. Have you successfully compiled other programs under Cygwin?

Posted: Tue Apr 08, 2008 5:36 pm
by zol
[edit]The release of CF 2.2beta2 makes the following obsolete so use that instead, 'kay? :wink: [/edit]


I'm no bash guru, but this script might be useful to fellow linux/console users.

It's a wrapper for cfdg that just calls cfdg normally, but replaces '_vc_' with the variation code in the output filename, if the given filename uses '_vc_'.

Code: Select all

#!/bin/bash

t=`expr ${@:(-1)} : '.*\(_vc_\)'`
if [ "$t" != "" ];then
    while read x;do
        if [ ! ${varcode} ]; then varcode=`expr "${x}" : '.*[[:blank:]]\([[:upper:]]*\)[^[:alnum:]]'`;fi
        echo $x #output normally
    done < <(./cfdg "$@")
    fname=${@:(-1)}
    if [ -f ${fname} ];then mv ${fname} ${fname//_vc_/$varcode};fi
else
    ./cfdg "$@"
fi
(Just don't use '-q' :? )