Non-Gui, console only

Let the developers know what you think of the software and what can be done to either improve the CFDG language or the Context Free program.

Moderators: MtnViewJohn, chris, mtnviewmark

andrewborrell
Posts: 8
Joined: Wed Apr 04, 2007 1:50 pm

Windows command line

Post 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.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post 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.

grabkate
Posts: 1
Joined: Mon Sep 10, 2007 4:38 pm

HELP!!

Post 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.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post 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?

User avatar
zol
Posts: 40
Joined: Sun Mar 23, 2008 4:14 pm

Post 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' :? )

Post Reply