[cad-linux] How many files to use? executables? then also makefile and compile them!

  • From: Janek Kozicki <janek_listy@xxxxx>
  • To: cad-linux@xxxxxxxxxxxxx
  • Date: Mon, 8 Sep 2003 06:09:18 +0200

BTW: i think that browsing the group will give better results when
sorted by date, not by thread. Because the ideas are evolving very
quickly, and the posts appear in many different threads.

Bruno Postle said:     (by the date of Sun, 7 Sep 2003 19:20:03 +0100)

> The approach taken by Massimiliano in xSpace is to represent all
> nested structures by directory relationships and all key->value
> relationships by filename->content pairs.  As a result there is no
> need for these complex structures within files.
> 
> The approach I took is not quite so thorough, nesting is still
> represented by a directory relationship, but I stopped there - I
> tried to keep all transactions as atomic as possible - Each file
> represents the most that could be deleted without breaking anything
> else (generally a single object).

the more I think about Massimiliano way of doing things (separating
so that each object is a directory, not a file), the more I like it.

For example because of the reason that Bruno pointed out:
 
> Possibly this would fall to pieces with more complex objects
> (solids, nurbs etc..) - That's an exercise that I haven't even
> looked at. 

Use a file name geometry. It can be a line, as well as a very
complicated mesh. It's a geometry of one object. And if this file can be
executable - any geometry can be created using any possible tools. To
say more! if there is no file named geometry, but instead if that a
directory called geometry, we can expect a lot of things inside. The
thing that I propose here is.... a makefile. Then executing this
directory (to obtain this directory) would be: enter this directory.
`make` run the executable called `geometry`. (yes, it's a compiled C
program!)

other thing:

suppose that we want a big amount of objects to have a certain
attribute. Let's say that we want 1200 different objects scattered in a
directory structure to change their Attribute named "layer" from 'road'
to 'pavement'.

in Massimiliano's model there are two ways of doing this:
create a file $DRAWING/Attributes/Layers/pavement

1. then symlink this file in each of 1200 directories, all of them
containing single object

2. make a file called ./attributes , inside this file declare attributes
that are inherited by all files present in current directory, and all
directories of this directory subtree. If all 1200 fall into this
directory subtree - problem is solved. If no? then softlink it several
times, to cover all 1200 files.

* please note: 

- directory Attributes/  contains Attributes definitions (another
directories) like: Attributes/Layers/ , Attributes/Linetypes/ (I've been
already talking about that) 

- text-file OR directory OR executable ./attributes  declares what
attributes should be inherited in that file's directory structure. No
matter what kind of file is this - after executing it we would expect a
text-formatted output.


in Bruno's model the solution I proposed was to store in each file a
information about its attributes. So there is only one solution

1 - browse through all 1200 files and change this one line:

Attribute: Layer road
into
Attribute: Layer pavement

what if files are hard to track by any combination of grep/whatever?


That's why I prefer Massimiliano's way...

I'm going to start a specification.... :)) with a following thing:

* A directory based data consists of directories and files.
* All directories start with uppercase letter, all files start 
  with lowercase letter.
* all files can also be a directory, but starting with a lowercase letter
* a directory with a name starting with a lowercase letter is entered and
  executed by running `read` program inside it. the output of this program
  is treated as a content of the file that should be in place of this
  directory. 

note: `read` program can run make with some makefile, and then execute
      something, to get the output.

note: Thruogh the rest of this document all directories starting with
      uppercase letter are called "directory", but all directories starting
      with lowercase letter are called "file"

note: sometimes executed programs may want to generate an error. So it is
      possible to have a text file with line "Error : <purpose>" inside it.
      Such a file will be treated as non-existing by all parsers that want
      to display/process the data. Istead the module that executes `read`
      program will give a warning to the user, that an Error was encountered.

-- 
# Janek Kozicki

Other related posts: