CN112905159A - File clearance method based on CVI - Google Patents

File clearance method based on CVI Download PDF

Info

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
Application number
CN201911227082.2A
Other languages
Chinese (zh)
Inventor
刘异
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Huahang Radio Measurement Research Institute
Original Assignee
Beijing Huahang Radio Measurement Research Institute
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Huahang Radio Measurement Research Institute filed Critical Beijing Huahang Radio Measurement Research Institute
Priority to CN201911227082.2A priority Critical patent/CN112905159A/en
Publication of CN112905159A publication Critical patent/CN112905159A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete 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

File clearance method based on CVI
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.
Figure BDA0002302536990000031
Figure BDA0002302536990000041
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.
Figure BDA0002302536990000051
Figure BDA0002302536990000061
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.
CN201911227082.2A 2019-12-04 2019-12-04 File clearance method based on CVI Pending CN112905159A (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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
US10210166B2 (en) Systems and methods for managing shared content based on sharing profiles
RU2398266C2 (en) Application of data binding mechanism to perform command binding
US11157468B2 (en) System for multi-release and parallel development of a database
US20150100542A1 (en) Automatic generation of an extract, transform, load (etl) job
US20060235892A1 (en) Generating storage reports using volume snapshots
US10726040B2 (en) Lossless conversion of database tables between formats
JP7304480B2 (en) Correlated incremental loading of multiple datasets for interactive data prep applications
US20230121493A1 (en) Low-latency database system
Nabi Pro Spark Streaming: The Zen of Real-Time Analytics Using Apache Spark
US9003355B2 (en) Decentralized workflow management system
US8589454B2 (en) Computer data file merging based on file metadata
US8874622B2 (en) Flexible order of authoring for data integration solutions
US7962453B2 (en) Dynamic redistribution of a distributed memory index when individual nodes have different lookup indexes
CN112905159A (en) File clearance method based on CVI
CN114443159A (en) Plug-in processing device and method, computer equipment and storage medium
Annighoefer et al. EOQ: An open source interface for a more DAMMMMN domain-specific model utilization
CN109918346A (en) A kind of creation method and device of file
US8543969B2 (en) Method and apparatus for developing a computer program utilizing a service oriented architecture
US11308272B1 (en) Controlling a productivity application to integrate a revision stream and an undo stack to perform out of order undo operations
US8626800B2 (en) Synchronization of artifacts across different domains
CN108170717B (en) Data exploration mode conversion method and device, storage medium and electronic equipment
CN111459887B (en) Resource screening method and device, electronic equipment and storage medium
Kozlovics et al. A kernel-level UNDO/REDO mechanism for the Transformation-Driven Architecture
CN115277674A (en) Picture compression method, device, electronic equipment, medium and program product

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