On Tuesday, April 29, 2014 6:33:46 PM UTC+2, Freddie Chopin wrote:
>
> W dniu 2014-04-27 17:01, Lee Winter pisze: 
> > The problem I see is that the above command uses a file, a.out.icon, 
> > for both input and output.  Tup's file usage model is very primitive. 
> > A rule is allowed to use a file for only input or for only output.  I 
> > suspect this simplifies the DAG because writing a file, reading it, 
> > and re-writing it, as you attempted above, makes the DAG more complex. 
> >   It shouldn't be a problem, but it is. 
>
> Just use two different names for the files and the "problem" is 
> solved... Using the same file for input and output is not worth any 
> trouble, as that is an endless source of problems, while this feature 
> has no real value... 
>
> In case you overwrite the input file with the output such "feature" 
> makes no sense at all. 
>
> In case you append to the input file with additional output the problem 
> is that this just doesn't fit the model of building - what would you do 
> if the "basic" part of the source (the ones which CREATE the file) don't 
> change, and the "append" part does? You cannot "unappend" it before 
> appending the changed part, so you have to build that from scratch... 
>
> Additional problem is when you have rules which only read from such file 
> - do they read the version before or after the modification? Whichever 
> you choose its just your preference and everyone has his/her own... So 
> either you have to complicate the syntax to explicitly state that (what 
> about a case where you have 100 such read-write rules for a single 
> file?) or the creator of software has to decide for everyone, making the 
> "opposite camp" dissatisfied. 
>
> In return you get no real value, as this whole "problem" can be easily 
> avoided by just using different name for the output file. 
>
> Regards, 
> FCh 
>

Note that the command does not have the same input and output. a.out is the 
input, and a.out.icon is the output

Rez, just because of the way it operates, updates a file in-place, which is 
why I copy the file before appending the the icon to its resource fork. I 
would love it if it allowed for specifying a different output file for this 
operation, but it doesn't.

I've reduced it to a minimal pair. The first does not use Rez, and simply 
copies and then adds a line to its input:

: a.out |> cp a.out a.out.icon; echo hello >> a.out.icon |> a.out.icon 

The second uses rez to add a resource fork to the file:

: a.out |> cp a.out a.out.icon; Rez -append icon.rsrc -o a.out.icon |> 
a.out.icon

The first works with no error, the second fails with the error I gave 
before.

-- 
-- 
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to