Join us at IRC!
One mans freedom fighter, another's terrorist.
Wednesday, May 23, 2012
Navigation
Members Online
Total Online: 38
Web Spiders: 19
Guests Online: 36
Members Online: 2

Registered Members: 70172
Newest Member: kosova
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Creating a Simple Scripting Language.

Tyler3791
Member

Posts: 14
Location: NC
Joined: 20.10.09
Rank:
Apprentice
Posted on 22-12-09 22:08
I can do all the parsing and other related crap, but I was wondering how I would I make it interpret a file(like how a .bat is processed without having to be typed every time). I guess my real question is what does Windows send to a program when a file set to be opened by that program is double clicked. Would the path to the file that was double clicked be in argv?
N/A N/A N/A
Author

RE: Creating a Simple Scripting Language.

Compromise
Member

Posts: 224
Location:
Joined: 11.11.09
Rank:
Moderate
Warn Level: 30
Posted on 22-12-09 22:39
environment variables.

Right-click "my computer", it's somewhere in there.


CrazySpai
minecraft.net
Author

RE: Creating a Simple Scripting Language.

Tyler3791
Member

Posts: 14
Location: NC
Joined: 20.10.09
Rank:
Apprentice
Posted on 22-12-09 22:49
I know what environment variables are, just type "set" into cmd and you see *most* of them. But what would be sent to my program and how would I access the information sent to it? I guess another example that may clarify, is how when you click a .txt, it is automatically opened/displayed by notepad.
N/A N/A N/A
Author

RE: Creating a Simple Scripting Language.

Compromise
Member

Posts: 224
Location:
Joined: 11.11.09
Rank:
Moderate
Warn Level: 30
Posted on 22-12-09 22:51
You provide a path to the binary that handles opening the file, and you associate a file extension with a file.

It's a bit different on non-windows systems, though you can just expect people to put the file-to-be-opened as an argument of the program.


CrazySpai
minecraft.net
Author

RE: Creating a Simple Scripting Language.

reaper4334
Member



Posts: 314
Location: Uk
Joined: 24.11.06
Rank:
God
Posted on 22-12-09 23:37
Hm, not sure what exactly you're trying to ask.. but I think spy and mosh have pretty much covered it..

Tyler3791 wrote:
Would the path to the file that was double clicked be in argv?

In most cases, yes.






reaper4334@hotmail.co.uk http://reaper4334.freehostia.com
Author

RE: Creating a Simple Scripting Language.

Tyler3791
Member

Posts: 14
Location: NC
Joined: 20.10.09
Rank:
Apprentice
Posted on 22-12-09 23:51
Compromise wrote:
You provide a path to the binary that handles opening the file, and you associate a file extension with a file.

I'm asking from the point of view of the binary, how does the binary get the path to the file it's supposed to open?
N/A N/A N/A
Author

RE: Creating a Simple Scripting Language.

Tyler3791
Member

Posts: 14
Location: NC
Joined: 20.10.09
Rank:
Apprentice
Posted on 23-12-09 01:41
I(with help) figured it out, thanks. The path to the file is in argv[1].
[edit]I got rid of the insulting "anyway," happy?[/edit]

Edited by Tyler3791 on 23-12-09 06:34
N/A N/A N/A
Author

RE: Creating a Simple Scripting Language.

Tyler3791
Member

Posts: 14
Location: NC
Joined: 20.10.09
Rank:
Apprentice
Posted on 23-12-09 03:11
Yep, and all by myself too.:p
[edit]In case it wasn't clear, that's sarcasm for thanks for your help.[/edit]

Edited by Tyler3791 on 23-12-09 03:12
N/A N/A N/A
Author

RE: Creating a Simple Scripting Language.

Compromise
Member

Posts: 224
Location:
Joined: 11.11.09
Rank:
Moderate
Warn Level: 30
Posted on 23-12-09 05:42
Thanks anyway.

Anyway...


Aaaanyyyyywaaaayyyyy...

Sheesh.


CrazySpai
minecraft.net
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.