Follow us on Twitter!
It is the path of least resistance that makes rivers and men crooked. - Bj Palmer
Wednesday, April 23, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 22
Guests Online: 18
Members Online: 4

Registered Members: 82876
Newest Member: bhl1986
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

print directories


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 11-04-06 23:23
can anyone tell what commands do i need for a program in c, to print in the screen the directories? like command "dir" for windows, or "ls" for linux???thanx.


Author

RE: print directories


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 11-04-06 23:27
well
i believe there is a command in which you do something like command(""Wink or something, but look it up because i dont really know C++.


Author

RE: print directories


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 12-04-06 03:31
That was certainly helpful.

There is a command called 'system' in stdlib.h for in an ANSI-compliant setup. It works, but the return isn't very helpful, and without overloading support like C#, it can be bothersome for more than destructive applications that just do rm -rf /.

Try using execl() instead, coupled with fork or pipe.


Author

RE: print directories


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 12-04-06 12:27
At least I tried, instead of bashing someone whom I didn't even do anything to.


Author

RE: print directories

SySTeM
Member

Your avatar

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
HBH Guru
Posted on 12-04-06 12:46
I'd just use system("dir"Wink if I was on windows, although this is for C++, I don't know if it would work in C


img138.imageshack.us/img138/6527/sig2ak1.jpg
www.hellboundhackers.org/sig/r/2783.png

http://www.elites0ft.com/
Author

RE: print directories


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 12-04-06 14:33
...Grin