如何在C中创建新目录 [英] How to create a new directory in C
问题描述
我记得我可以在Unix和Linux中轻松地在当前目录中创建一个新文件夹。
system(" mkdir sub_directory");
但在Windows系统下未能这样做。有什么建议吗?
I remember that I could create a new folder in the current directory easily
in Unix and Linux by something like
system("mkdir sub_directory");
But failed to do so under Windows System. Any suggestions?
推荐答案
munanxue< xu ********* @ yahoo.com>这样说:
munanxue <xu*********@yahoo.com> spoke thus:
我记得我可以在Unix和Linux中轻松地在当前目录中创建一个新文件夹,例如
system(mkdir sub_directory ;);
但在Windows系统下未能这样做。有什么建议吗?
I remember that I could create a new folder in the current directory easily
in Unix and Linux by something like
system("mkdir sub_directory");
But failed to do so under Windows System. Any suggestions?
当然,即使这个问题不适合这个小组:
http://www.ungerhu.com/jxh/clc.welcome.txt
< a rel =nofollowhref =http://www.eskimo.com/~scs/C-faq/top.htmltarget =_ blank> http://www.eskimo.com/~scs/C -faq / top.html
http: //benpfaff.org/writings/clc/off-topic.html
创建目录的DOS命令是md,而不是mkdir。由于显而易见的原因,将Unix
命令传递到DOS shell是不太可能产生你想要的结果。
- -
Christopher Benson-Manica |我*应该*知道我在说什么 - 如果我
ataru(at)cyberspace.org |不,我需要知道。火焰欢迎。
Sure, even though this question is not topical for this group:
http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html
The DOS command to create a directory is md, not mkdir. Passing Unix
commands to a DOS shell is, for obvious reasons, unlikely to
produce the results you want.
--
Christopher Benson-Manica | I *should* know what I''m talking about - if I
ataru(at)cyberspace.org | don''t, I need to know. Flames welcome.
>我记得我可以在Unix和Linux中轻松地
>I remember that I could create a new folder in the current directory easily
在当前目录中创建一个新文件夹系统(mkdir sub_directory);
但是在Windows系统下未能这样做。有什么建议吗?
in Unix and Linux by something like
system("mkdir sub_directory");
But failed to do so under Windows System. Any suggestions?
你在命令提示符下输入什么命令来创建Windows中的目录
? system()使用的命令解释器往往与交互式用户使用的命令解释器相同。
也意识到概念的概念;当前目录在Windows和Unix之间以不同的方式工作
。文件/目录权限也是如此。
Gordon L. Burditt
What command would you type at a command prompt to create a directory
in Windows? system() uses a command interpreter that tends to be
the same as one of the ones used by interactive users.
Also realize that the concepts of "current directory" work a little
differently between Windows and Unix. So do file/directory permissions.
Gordon L. Burditt
1。 mkdir可以在Windows中创建一个新目录,就像md。
2. system(" md sub_directory");失败了,我测试之前我发布了
这个帖子。
其他任何建议吗?
1. mkdir can create a new directory in Windows, just as md.
2. system("md sub_directory"); failed as well, i tested before I posted
this thread.
any other suggestions?
这篇关于如何在C中创建新目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!