how to run scripts in the subfolder of scratch

246 views
Skip to first unread message

zhaoyu

unread,
Aug 14, 2014, 12:33:39 AM8/14/14
to ns-3-...@googlegroups.com
I make  a subfolder under the "scratch" folder, then add a new scripts.
but i run like this:
<code>
./waf --run scratch/mytest/test.cc
</code>

then there comes a problem:
the program can't find.

So I want to know how to run a script under a subfolder of scratch.
Thanks!

Tommaso Pecorella

unread,
Aug 14, 2014, 2:02:11 AM8/14/14
to ns-3-...@googlegroups.com
./waf --run scratch/mytest

if you use a subfolder, the program name is the name of the subfolder.

T.

zhaoyu

unread,
Aug 14, 2014, 9:51:21 PM8/14/14
to ns-3-...@googlegroups.com
yeah, I have tried. I change the program's name as the subfolder's name. Then it's ok!
But why? One subfolder can only have a program, I think this design is not very good!
 Where do u find this knowledge?
Thanks!

在 2014年8月14日星期四UTC+8下午2时02分11秒,Tommaso Pecorella写道:

Tommaso Pecorella

unread,
Aug 15, 2014, 3:28:39 AM8/15/14
to ns-3-...@googlegroups.com
Hi,

the "knowledge" is from the tutorial and manual.
The design (to have just one program per sub-folder) is a design choice. You may not like it, but you can't deny that it works.
If you need a more complex system - nobody so far had this issue - you're free to modify the wscript and tweak it.

The current system perfectly fits the current goal: scratch is where the user's scripts are and any script can be either:
1) a single .cc (just place it in the scratch)
2) some .cc and .h (use a subfolder)

This, of course, does not help in a multi-user environment, where each user may want to have its own sub-tree in scratch. However, usually the users have different accounts altogether in moderns OS, so this is not an issue.

Anyway, feel free to propose alternatives and submit to ns-dev mailing list with the modified wscript.

Cheers,

T.

zhaoyu

unread,
Aug 15, 2014, 4:05:32 AM8/15/14
to ns-3-...@googlegroups.com
thanks very much!
Now, I have read the wscript. It helps me much~
Now I make a subfolder under the folder of "examples", maybe this is a better choice for me!

在 2014年8月15日星期五UTC+8下午3时28分39秒,Tommaso Pecorella写道:
Reply all
Reply to author
Forward
0 new messages