VC中的系统调用 [英] system call in VC

查看:49
本文介绍了VC中的系统调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候所有。


我正在尝试在WinXP上进行系统调用,


#include< stdlib.h>


int main()

{

system(" ls -al");

}


但它什么都不做!!


有没有人经历过这样的事情!?我相信有一个

库在我安装VC时错过了但是我不确定。


任何建议,提示,指针等都是很大的赞赏。


干杯

Greetings all.

I am trying to make a system call as on WinXP,

#include <stdlib.h>

int main()
{
system( "ls -al");
}

but it is doing nothing!!

Has anybody ever experienced such a thing!? My belief is there is a
library that was missed when I installed VC but I am not sure.

Any suggestions, hints, pointers etc etc is greatly appreciated.

Cheers

推荐答案

ka ***************** @ yahoo.ca 说:
问候所有。

我正在尝试在WinXP上进行系统调用,

#include< stdlib.h>

int main()
{
系统(ls -al);
}

但它什么都不做! !

有没有人经历过这样的事情!?我相信有一个
库在安装VC时错过了但我不确定。

任何建议,提示,指针等等都非常感谢。
Greetings all.

I am trying to make a system call as on WinXP,

#include <stdlib.h>

int main()
{
system( "ls -al");
}

but it is doing nothing!!

Has anybody ever experienced such a thing!? My belief is there is a
library that was missed when I installed VC but I am not sure.

Any suggestions, hints, pointers etc etc is greatly appreciated.




首先,检查你的系统是否有接受开关的ls命令

-al。在你的情况下,它很可能不会,因为ls通常不会与Windows系统相关联的
命令。


其次,如果你的系统确实支持一个ls命令,考虑系统调用执行速度很快的可能性,你只需要b / b
看不到它。例如,考虑做类似的事情:


system(&ls -al> listing.txt");


然后检查对于listing.txt的存在。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)



Firstly, check that your system has an ls command that accepts the switch
-al. It is quite likely in your case that it does not, since ls isn''t a
command normally associated with Windows systems.

Secondly, if your system does support an ls command, consider the
possibility that the system call is executing so quickly that you simply
don''t see it. For example, consider doing something like:

system("ls -al > listing.txt");

and then checking for the existence of listing.txt.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


ka ***************** @ yahoo.ca 写道:

所有问候。

我正在尝试像在WinXP上进行系统调用,

#include< stdlib.h> ;

int main()
{
系统(ls -al);
}

但它什么都不做!!

有没有人经历过这样的事情!?我相信有一个
库在安装VC时错过了但我不确定。

任何建议,提示,指针等等都非常感谢。

Greetings all.

I am trying to make a system call as on WinXP,

#include <stdlib.h>

int main()
{
system( "ls -al");
}

but it is doing nothing!!

Has anybody ever experienced such a thing!? My belief is there is a
library that was missed when I installed VC but I am not sure.

Any suggestions, hints, pointers etc etc is greatly appreciated.




尝试替换ls -al与dir -al


-

pete



Try replacing "ls -al" with "dir -al"

--
pete


pete说:
pete said:
尝试替换ls -al用dir -al
Try replacing "ls -al" with "dir -al"




你确定* dir需要-al吗?我不是。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)



Are you *sure* dir takes -al? I''m not.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


这篇关于VC中的系统调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆