Hi Supragya Raj,
On 04/27/2017 08:19 AM, Supragya Raj wrote:
> This concept brings to one more thing... since the C implementations of
> libraries can directly talk to vfs and do all things behind, how do
> shellecho like *<% mkdir newfolder >* are handled - using such internal
> implementations of C libraries or any other way? I would say there are
> two ways of handling this - after making the substitution in these shell
> commands like *<% mkdir {$var} >* , we may send this for execution to
> bdsh - or handle it ourselves and talk to system directly - using self
> implemented mkdir and a list of other commands. I thought over it and
> here is what I decided finally (I may be wrong) - Send all such
> execution requests to bdsh - this allows a few things - for one, the
> interpreter would never have to worry about implementations of redirects
> and pipes, since they will be handled the way bdsh handles the current
> commands of such types. Any output request that you may need from such a
> command can be easily done - whenever HLang calls bdsh - it asks to save
> any outputs to a file and send it back to interpreter (through IPC or
> other ways). This data (outputs) can be gathered and brought back into
> the script using again - a library function designed specifically for
> this - something like *declare $var = HL_STDOUT("<% cat helloworld.cpp |
> grep hello >"); *This command calls library function - which internally
> calls shellecho (shell.c) with a message notifying that output may be
> required back - this is then sent to bdsh and output is captured and
> given back to HLang (obvious modifications are needed in BDSH). This
> frees up the language from worrying about pipes and makes use of
> available infrastructure. However, this is not maybe what some of you
> want - given BDSH is something you want changed. In that case, HLang can
> itself handle execution fully without bdsh - just it would need another
> module that services shell.c and implements all commands such as mkdir,
> cat etc. Also in that case, the syntax never changes - you still use *<%
> mkdir {$var} > *without worrying whether it goes to bdsh or to internal
> HLang implementation of mkdir.
I think if there is an option to design this so that it is independent
from bdsh (with the prospect of bdsh being replaced with something else
eventually), I'd go for it. Moreover, the implementation would not be
talking to the VFS server directly and would not implement its own
mkdir(), it would just provide a binding to the libc's mkdir / the newly
added vfs_link_path().
Jakub
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel