CN112905159A - File clearance method based on CVI - Google Patents
File clearance method based on CVI Download PDFInfo
- Publication number
- CN112905159A CN112905159A CN201911227082.2A CN201911227082A CN112905159A CN 112905159 A CN112905159 A CN 112905159A CN 201911227082 A CN201911227082 A CN 201911227082A CN 112905159 A CN112905159 A CN 112905159A
- Authority
- CN
- China
- Prior art keywords
- cvi
- calling
- function
- folder
- deleting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 15
- 238000013461 design Methods 0.000 claims description 5
- 238000011161 development Methods 0.000 abstract description 7
- 238000012360 testing method Methods 0.000 abstract description 5
- 238000012217 deletion Methods 0.000 abstract description 3
- 230000037430 deletion Effects 0.000 abstract description 3
- 230000018109 developmental process Effects 0.000 description 7
- 238000005259 measurement Methods 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000008140 language development Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
- G06F16/162—Delete operations
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Human Computer Interaction (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a folder emptying method based on CVI, which deletes all types of files by utilizing a multi-layer function calling mode, and realizes the function of emptying and deleting a folder containing one or more layers of file paths on a CVI development platform by combining two modes of function nesting calling and recursive calling. The invention realizes the quick deletion of all types of files and paths in all levels in the folder specified by the user, and greatly reduces the code development and test workload of the related functions of the test control software development.
Description
Technical Field
The invention belongs to the technical field of software development, and particularly relates to a folder emptying method based on a CVI (visual basic input/output).
Background
CVI is an interactive C language development platform introduced by the national instruments company of America, is provided with a rich resource library for measurement, analysis and engineering UI design in the CVI, and is widely applied in the field of measurement and control. The software developer can utilize the measurement and control program determined by the software developer aiming at the special device development function, wherein the measurement and control program often comprises hardware operation such as deletion of files.
CVI provides a developer with a function DeleteFile () for deleting a single specific file and a function DeleteDir () for deleting an empty file path (i.e., an empty folder), but does not provide a function for clearing a folder containing one or more hierarchical file paths. When the measurement and control software function based on the CVI needs to realize quick clearing and deletion of the folder containing the complex path, a developer will increase a large amount of workload of code development and testing.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a folder emptying method based on CVI, so that the folder function of emptying and deleting a folder containing one or more layers of file paths based on a CVI development platform is realized.
In order to solve the technical problem, the method for clearing the folder based on the CVI provided by the invention comprises the following steps:
step S1, obtaining a target folder, namely a target path to be emptied and deleted, by using a CVI standard function DirSelectPop ();
step S2, design function DeleteFileAll (): deleting all files in the top layer of the target path in a query-by-query mode by utilizing a CVI standard function GetFirstFile (), GetNextFile () and DeleteFile ();
step S3, design function DeleteFolderAll (): utilizing CVI standard functions GetFirstFile () and DeleteDir (), and nesting calling the function DeleteFileAll () in the step S2, calling the function DeleteFolderAll () in the step S3 by combining a recursive calling method, and deleting all folders in the top layer of the target path in a one-by-one query mode;
and step S4, deleting the target folder by using a CVI standard function DeleteDir (), namely emptying and deleting the target path.
Compared with the prior art, the invention has the beneficial effects that:
1. the file folder function for emptying and deleting the file path with one or more layers on the CVI development platform is realized by deleting all types of files in a multi-layer function calling mode and combining a function nesting calling mode and a recursive calling mode.
2. The CVI platform is used for developing application software, and a mode of replacing manual operation with one key is adopted, so that all types of files and paths in all levels in a folder designated by a user can be deleted quickly.
3. The code development and test workload of the related functions of the test control software development is greatly reduced.
Drawings
Fig. 1 is a flowchart illustrating a CVI-based folder emptying method according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be further described with reference to the accompanying drawings and examples.
Fig. 1 is a schematic flowchart of a CVI-based folder emptying method according to an embodiment of the present invention, which specifically includes the following steps:
step S1, obtain the target folder, i.e. the target path to be cleared and deleted, by using the CVI standard function DirSelectPopup (). If the folder "AB" in "E: \ administration \", i.e. the path "E: \ administration \ AB \".
Step S2, designing a function DeleteFileAll (), deleting all files in the top layer of the target path, and realizing the following steps:
s2.1, calling a CVI standard function GetFirstFile () to inquire any file in the top layer of the target path, and calling a CVI standard function DeleteFile () to delete the file;
s2.2, calling a CVI standard function GetNextFile () to inquire any other file in the top layer, and calling a CVI standard function DeleteFile () to delete the file;
and S2.3, circulating the step S2.2, and deleting all the files in the top layer one by one.
Specific code implementations are shown below.
Step S3, designing a function DeleteFolderAll (), deleting all folders in the top layer of the target path, and realizing the following steps:
s3.1, calling a CVI standard function GetFirstFile () to inquire any folder in the top layer of the target path;
s3.2, nesting and calling the function DeleteFileAll () of the step S2 to delete all files in the folder;
step S3.3, calling a function DeleteFolderAll () of the step S3 by combining a recursive calling method to delete all folders and all files below the folders;
s3.4, when the folder is emptied, calling a CVI standard function DeleteDir () to delete the folder;
and S3.5, circulating the steps S3.1 to S3.4, and deleting other folders in the top layer of the target path one by one.
Specific code implementations are shown below.
4. At this time, the target folder is emptied, and the folder is deleted by using a CVI standard function DeleteDir (), namely, the target path is emptied and deleted.
Claims (3)
1. A method for clearing a folder based on CVI comprises the following steps:
step S1, obtaining a target folder, namely a target path to be emptied and deleted, by using a CVI standard function DirSelectPop ();
step S2, design function DeleteFileAll (): deleting all files in the top layer of the target path in a query-by-query mode by utilizing a CVI standard function GetFirstFile (), GetNextFile () and DeleteFile ();
step S3, design function DeleteFolderAll (): utilizing CVI standard functions GetFirstFile () and DeleteDir (), and nesting calling the function DeleteFileAll () in the step S2, calling the function DeleteFolderAll () in the step S3 by combining a recursive calling method, and deleting all folders in the top layer of the target path in a one-by-one query mode;
and step S4, deleting the target folder by using a CVI standard function DeleteDir (), namely emptying and deleting the target path.
2. The CVI-based folder emptying method as claimed in claim 1, wherein said step S2 includes the steps of:
s2.1, calling a CVI standard function GetFirstFile () to inquire any file in the top layer of the target path, and calling a CVI standard function DeleteFile () to delete the file;
s2.2, calling a CVI standard function GetNextFile () to inquire any other file in the top layer, and calling a CVI standard function DeleteFile () to delete the file;
and S2.3, circulating the step S2.2, and deleting all the files in the top layer one by one.
3. A method of CVI-based folder emptying as claimed in claim 1 or 2, wherein said step S3 includes the steps of:
s3.1, calling a CVI standard function GetFirstFile () to inquire any folder in the top layer of the target path;
s3.2, nesting and calling the function DeleteFileAll () of the step S2 to delete all files in the folder;
step S3.3, calling a function DeleteFolderAll () of the step S3 by combining a recursive calling method to delete all folders and all files below the folders;
s3.4, when the folder is emptied, calling a CVI standard function DeleteDir () to delete the folder;
and S3.5, circulating the steps S3.1 to S3.4, and deleting other folders in the top layer of the target path one by one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911227082.2A CN112905159A (en) | 2019-12-04 | 2019-12-04 | File clearance method based on CVI |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911227082.2A CN112905159A (en) | 2019-12-04 | 2019-12-04 | File clearance method based on CVI |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112905159A true CN112905159A (en) | 2021-06-04 |
Family
ID=76104471
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911227082.2A Pending CN112905159A (en) | 2019-12-04 | 2019-12-04 | File clearance method based on CVI |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112905159A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102508855A (en) * | 2011-09-28 | 2012-06-20 | 北京安天电子设备有限公司 | Method and device for quickly clearing data in storage medium |
US20140337291A1 (en) * | 2013-05-10 | 2014-11-13 | Box, Inc. | Top down delete or unsynchronization on delete of and depiction of item synchronization with a synchronization client to a cloud-based platform |
US20180075056A1 (en) * | 2016-09-15 | 2018-03-15 | Pure Storage, Inc. | Adaptive concurrency for write persistence |
CN109710455A (en) * | 2018-11-22 | 2019-05-03 | 厦门市美亚柏科信息股份有限公司 | Deletion file access pattern method and system based on FAT32 file system |
-
2019
- 2019-12-04 CN CN201911227082.2A patent/CN112905159A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102508855A (en) * | 2011-09-28 | 2012-06-20 | 北京安天电子设备有限公司 | Method and device for quickly clearing data in storage medium |
US20140337291A1 (en) * | 2013-05-10 | 2014-11-13 | Box, Inc. | Top down delete or unsynchronization on delete of and depiction of item synchronization with a synchronization client to a cloud-based platform |
US20180075056A1 (en) * | 2016-09-15 | 2018-03-15 | Pure Storage, Inc. | Adaptive concurrency for write persistence |
CN109710455A (en) * | 2018-11-22 | 2019-05-03 | 厦门市美亚柏科信息股份有限公司 | Deletion file access pattern method and system based on FAT32 file system |
Non-Patent Citations (4)
Title |
---|
AOAN1126: "windows 删除文件夹所有文件夹及文件代码", pages 1 - 2 * |
AOAN1126: "windows 删除文件夹所有文件夹及文件代码", pages 1 - 2, Retrieved from the Internet <URL:https://blog.csdn.net/aoan1126/article/details/102260956> * |
邵国强: "文件夹传输算法研究", 山东轻工业学院学报, vol. 21, no. 1, pages 40 - 42 * |
韦一平: "递归实现的对多级嵌套目录的删除算法", no. 3, pages 94 - 95 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7409405B1 (en) | File dispatcher for multiple application targets | |
US9742865B2 (en) | Systems and methods for managing shared content based on sharing profiles | |
US10019536B2 (en) | Snapshot-consistent, in-memory graph instances in a multi-user database | |
RU2417419C2 (en) | Intelligent container indexing and performing search therein | |
RU2398266C2 (en) | Application of data binding mechanism to perform command binding | |
US20150100542A1 (en) | Automatic generation of an extract, transform, load (etl) job | |
US20200081872A1 (en) | System for multi-release and parallel development of a database | |
US20110239231A1 (en) | Migrating electronic document version contents and version metadata as a collection with a single operation | |
JP7199522B2 (en) | Correlated incremental loading of multiple datasets for interactive data prep applications | |
US7548939B2 (en) | Generating storage reports using volume snapshots | |
US9003355B2 (en) | Decentralized workflow management system | |
US8589454B2 (en) | Computer data file merging based on file metadata | |
Nabi | Pro Spark Streaming: The Zen of Real-Time Analytics Using Apache Spark | |
US7962453B2 (en) | Dynamic redistribution of a distributed memory index when individual nodes have different lookup indexes | |
US8874622B2 (en) | Flexible order of authoring for data integration solutions | |
US20230121493A1 (en) | Low-latency database system | |
CN112905159A (en) | File clearance method based on CVI | |
US20070234278A1 (en) | Managing source code in a model-based development environment | |
JP2005190221A (en) | Cache control unit, its method, and computer program | |
CN104572802A (en) | Method and system used for loading data with complex relationships | |
US8990267B2 (en) | Synchronization of artifacts across different domains | |
EP4244739A1 (en) | Controlling a productivity application to integrate a revision stream and an undo stack to perform out of order undo operations | |
US20100115491A1 (en) | Method and apparatus for developing a software application | |
US9069583B2 (en) | Designer extensibility | |
US20100094812A1 (en) | Dynamically Defining and Using a Delete Cascade Trigger Firing Attribute |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20210604 |
|
WD01 | Invention patent application deemed withdrawn after publication |