• 全部
  • 问答

how can I empty all files in a fold?

djwinter 2006-08-18 08:36:18
how can I empty all the files in a fold by C++/C ??
software will running on unix like system.
...全文
184 点赞 收藏 10
写回复
10 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
pacman2000 2006-08-18
system("/bin/rm -f /somedir/*");
回复
djwinter 2006-08-18
to OpenHero(雨流星(^_^看风云)) :
that what I am trying to do, have not find a proper way to do this, I think c++ STL should offer this simple dir operation for us, but .......................
wish anyone may face this before and can help.
回复
djwinter 2006-08-18
to: jiaowenhao
there is only config file in this fold, what I nead to do, is before recreate all the file, empty all the file first, avod the unexpected system error.
and can you let me know a little more detail about it?
回复
OpenHero 2006-08-18
maybe 现在是没有找到c/C++自己封装的文件系统的API
回复
djwinter 2006-08-18
so is that mean the onlyway can use is the system command? there is no way to complile the dir operation regardless the os?
回复
jiaowenhao 2006-08-18
编一个递归函数,遍历本目录下的所有文件包括文件夹,在遍历的同时检测,如果是文件就删除
回复
OpenHero 2006-08-18
你查找一下系统如何处理文件系统的API
遍历文件,删除文件,创建文件,文件操作是系统相关的操作
回复
djwinter 2006-08-18
the thing is I have absolutely no idea how to use standard C++/C to complile this. can you give me a example to delete "c:/temp", and recreate it?
回复
晨星 2006-08-18
Traverse the whole fold recursively, delete all each file and create a new empty one with the same name.
I think that will be OK.
回复
OpenHero 2006-08-18
u can look up the apis find how to view all the files in the folder ,and do what u want!
回复
相关推荐
How to Build a Python Bot That Can Play Web Games
转:http://code.tutsplus.com/tutorials/how-to-build-a-python-bot-that-can-play-web-games--active-11117 In this tutorial we'll explore the insand outs of building a Computer Vision-based game bot in ...
CS 2505 Computer Organization I C07: GIS System in C
CS 2505 Computer Organization I C07: GIS System in CVersion 2.10 This is a purely individual assignment! 1C Programming Structured Types, Files and Parsing, IndexingGeographic information systems orga...
Apache Lucene /Solr历史版本介绍及下载
原文地址:http://lucene.apache.org/ Apache LuceneTM项目开发开源搜索软件,包括:  Lucene Core是我们的旗舰子项目,提供基于Java的索引和搜索技术,以及拼写检查,突出显示和高级分析/标记化功能。...
【OH】SET System Variable Summary SQLPLUS 系统变量设置
【OH】SET System Variable Summary SQLPLUS 系统变量设置 SET System Variable Summa...
The MySQL 8.0.0 Milestone Release is available
http://mysqlserverteam.com/the-mysql-8-0-0-milestone-release-is-available/ The MySQL Development team is happy to announce our 8.0.0 development milestone release (DMR), now available for downloa
c++17新特性
Many of these descriptions and examples come from various resources (see [Acknowledgements](#acknowledgements) section), summarized in my own words. C++17 includes the following new language features...
Web 站点提速的最佳实践(Best Practices for Speeding Up Your Web Site)
Web 站点提速的最佳实践(Best Practices for Speeding Up Your Web Site)
Installing GCC: Configuration
Installing GCC: Configuration ... most GNU software, GCC must be configured before it can be built. This document describes the recommended configuration procedure for both native and cross target
Linux kernel coding style
Linux kernel coding style ...This is a short document describing the preferred coding style for the linux kernel. Coding style is very personal, and I won't _force_ my views on anybody, but this is wha
pycharm使用总结
参考:http://www.wtoutiao.com/a/2454799.html pycharm常用设置: file -> Setting ->Editor 1. 设置Python自动引入包,要先在 >general > autoimport -> python :show popup 快捷键:Alt + Enter: 自动添加包 ...
Creating a Game with CocosBuilder
Creating a Game with CocosBuilder ...This tutorial aims to show how you can useCocosBuildertogether withcocos2d-iphoneto create character animations, game maps and interfaces. CocosBuilder ha...
How to think like a Computer Scientist: 课后习题第十八章9-11
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: penglaixy # # Created: 19/09/2013 # Copyright: (c) penglaixy 2
部分计算机代数系统对比Computer Algebra Software: Mathematica, Maxima, Pari/GP
Computer Algebra Software: Mathematica, Maxima, Pari/GP  a side-by-side reference sheet
Org Mode - Organize Your Life In Plain Text!
原文链接 ...1. How To Use This Document2. License3. Change History - What's new4. Getting Started 4.1. Getting org-mode with Git4.2. Org-Mode Setup4.3. Organizing Your Life Into
practice in Shell programming generally
This assignment aims to give youpractice in Shell programming generallyintroduce you to git &... give you a clear concrete understanding of its basic semanticsNote: the material in the lecture notes ...
Best Practices for Speeding Up Your Web Site
Best Practices for Speeding Up Your Web Site
sublime 3 自定义配置
{ "color_scheme": "Packages/User/SublimeLinter/Monokai Bright (SL).tmTheme", "expand_tabs_on_save": true, "font_size": 9, "hot_exit": false, "ignored_packages": [ "SublimeLinter-phplint", ...
Java 14 发布!不使用"class"也能定义类了?还顺手要干掉Lombok!
2020 年 3 月 17 日,JDK/Java 14 正式 GA(General Available)。JDK14特性一览:JEP 305: Patt...
How to build samba PDC and add client
Normal 0 false false false EN-US ZH-CN X-NONE MicrosoftInternetExplorer4
补充
def preprocessing(text): preprocessed_text =text return preprocessed_text import csv ...file_path=r'C:\Users\Administrator\Desktop\SMSSpamCollectionjsn.txt' ...sms=open(file_path,'r',enco...
vscode 默认setting.json配置
// Controls whether the diff editor shows changes in leading or trailing whitespace as diffs. "diffEditor.ignoreTrimWhitespace": true, // Controls whether the diff editor shows +/- indicators f...
Scripted: A JavaScript editor from VMware
Engineering Andy Clement October 11, 2012 The first version of the Scripted code editor has been released this week ...Although Scripted is a general purpose code editor, the initial focus is building a
提升网络站点的最佳实践
Minimize HTTP Requests 80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash
Sublime Text 2 设置文件详解
Sublime Text 2 设置文件详解 原文地址:http://www.linuxidc.com/Linux/2012-09
A Distributed Storage System for Structured Data
Bigtable: A Distributed Storage System for Structured Data Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach Mike Burrows, Tushar Chandra, Andrew Fikes, Rob.....
What's New in the Revit 2018 API
What's New in the Revit 2018 API The Revit 2018 includes numerous exciting enhancements for add-in developers. The highlights were pointed out in the DevDays Online API news presentation and v
VIM配置文件vimrc
VIM配置文件vimrcUbuntu 默认情况下只安装tiny-vim , 只要运行 sudo apt-get install vim 安装完整的vim就好了.vimrc 下载""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " ...
STM32F103中文数据手册
这个里面包含了STM32F103的各种型号的数据手册,方面理解
WPF中用于嵌入其他进程窗口的自定义控件(AppContainer)
WPF中用于嵌入其他进程窗口的自定义控件(AppContainer) 具体见博文:http://blog.csdn.net/zzzwwwppp11199988899/article/details/78131292
MSP430_RTC模块学习总结
这是自己在学习MSP430时,对RTC模块的总结,希望可以帮助刚入门者
发帖
C++ 语言
创建于2007-09-28

5.9w+

社区成员

C++ 语言相关问题讨论,技术干货分享,前沿动态等
申请成为版主
帖子事件
创建了帖子
2006-08-18 08:36
社区公告
暂无公告