CN109828962A - Method, apparatus, server and the storage medium for preventing file from accidentally deleting - Google Patents
Method, apparatus, server and the storage medium for preventing file from accidentally deleting Download PDFInfo
- Publication number
- CN109828962A CN109828962A CN201811556213.7A CN201811556213A CN109828962A CN 109828962 A CN109828962 A CN 109828962A CN 201811556213 A CN201811556213 A CN 201811556213A CN 109828962 A CN109828962 A CN 109828962A
- Authority
- CN
- China
- Prior art keywords
- subitem
- file
- deleted
- unsuppressible
- suppression
- 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.)
- Granted
Links
Abstract
The disclosure is directed to a kind of method, apparatus, server and storage mediums for preventing file from accidentally deleting, this method comprises: receiving the mark setting instruction of subitem unsuppressible-suppression, the subitem unsuppressible-suppression mark setting instruction includes the catalogue of subitem unsuppressible-suppression to be placed mark;Setting instruction is identified according to the subitem unsuppressible-suppression, is that the index node setting subitem unsuppressible-suppression of the catalogue identifies, to prevent the first order subitem of the catalogue from accidentally being deleted.The disclosure effectively prevents the file in network shared files storage system and is accidentally deleted, and improves the safety of the file in network shared files storage system.
Description
Technical field
This disclosure relates to File Sharing Technique field more particularly to a kind of method, apparatus for preventing file from accidentally deleting, service
Device and storage medium.
Background technique
Currently, every field all increasingly payes attention to team unity, and network shared files storage system provides file and is total to
The function of enjoying brings convenience for team unity, so that network shared files storage system has become in team unity not
Insignificant strong demand.
Due to the opening of network shared files storage system, shared user is possible to accidentally delete one while using
A little files, to bring certain safety problem.With the increase of shared number, the probability that file is accidentally deleted is also improved.
Summary of the invention
To overcome the problems in correlation technique, the disclosure provide it is a kind of prevent file accidentally delete method, apparatus, clothes
Business device and storage medium.
According to the first aspect of the embodiments of the present disclosure, a kind of method for preventing file from accidentally deleting is provided, comprising:
The mark setting instruction of subitem unsuppressible-suppression is received, the subitem unsuppressible-suppression mark setting instruction includes son to be placed
The catalogue of item unsuppressible-suppression mark;
Setting instruction is identified according to the subitem unsuppressible-suppression, is that subitem unsuppressible-suppression is arranged in the index node of the catalogue
Mark, to prevent the first order subitem of the catalogue from accidentally being deleted.
Optionally, after subitem unsuppressible-suppression is set for the index node of the catalogue and is identified, further includes:
File deletion commands are received, the file deletion commands include the store path of file to be deleted;
According to the store path, the parent directory of the file to be deleted is determined;
According to the parent directory, the index node of the parent directory is obtained;
When in the index node comprising subitem unsuppressible-suppression mark, stop deleting the file to be deleted.
Optionally, further includes:
When not including subitem unsuppressible-suppression mark in the index node, the file to be deleted is deleted.
It is optionally, described to delete the file to be deleted, comprising:
According to the title of the index node and the file to be deleted, the directory entry of the file to be deleted is determined;
According to the directory entry, the corresponding index node of the file to be deleted is determined;
The information of the file to be deleted and the file to be deleted in the corresponding index node of the parent directory is deleted,
And delete the corresponding index node of the file to be deleted.
It is optionally, described to delete the corresponding index node of the file to be deleted, comprising:
When current CPU usage is more than the first given threshold, mark is deleted for directory entry setting;
It when CPU usage is less than the second given threshold, is identified, is deleted described to be deleted according to the deletion of the directory entry
The corresponding index node of file, first given threshold are greater than second given threshold.
Optionally, after subitem unsuppressible-suppression is set for the index node of the catalogue and is identified, further includes:
It receives and the cancellation that subitem unsuppressible-suppression possessed by the catalogue identifies is instructed;
It is instructed according to the cancellation, cancels the subitem unsuppressible-suppression mark in the index node of the catalogue;
Receive the delete command to the first order subitem of the catalogue;
According to the delete command, when not including subitem unsuppressible-suppression mark in the index node for determining the catalogue,
The information of the first order subitem and the first order subitem in the index node is deleted, and deletes the first order subitem
Corresponding index node.
Optionally, the subitem unsuppressible-suppression is identified as extended attribute.
Optionally, the first order subitem includes file or folder.
According to the second aspect of an embodiment of the present disclosure, a kind of device for preventing file from accidentally deleting is provided, comprising:
Command reception module is set, is configured as receiving the mark setting instruction of subitem unsuppressible-suppression, the subitem can not be deleted
Except mark setting instruction includes the catalogue of subitem unsuppressible-suppression to be placed mark;
Unsuppressible-suppression identify and arrange module is configured as identifying setting instruction according to the subitem unsuppressible-suppression, is described
The index node setting subitem unsuppressible-suppression of catalogue identifies, to prevent the first order subitem of the catalogue from accidentally being deleted.
Delete command receiving module is configured as identifying it in the index node setting subitem unsuppressible-suppression for the catalogue
Afterwards, file deletion commands are received, the file deletion commands include the store path of file to be deleted;
Parent directory determining module is configured as determining the parent directory of the file to be deleted according to the store path;
Index node obtains module, is configured as obtaining the index node of the parent directory according to the parent directory;
Stopping modular is deleted, when being configured as in the index node comprising subitem unsuppressible-suppression mark, stops deleting
The file to be deleted.
Optionally, further includes:
First removing module is deleted when being configured as not including subitem unsuppressible-suppression mark in the index node
Except the file to be deleted.
Optionally, first removing module includes:
Directory entry determination unit is configured as determining institute according to the title of the index node and the file to be deleted
State the directory entry of file to be deleted;
Index node determination unit is configured as determining the corresponding index of the file to be deleted according to the directory entry
Node;
Unit is deleted, is configured as deleting the file to be deleted and the file to be deleted is corresponding in the parent directory
Information in index node, and delete the corresponding index node of the file to be deleted.
Optionally, the deletion unit includes:
Mark setting subelement is deleted, is configured as when current CPU usage is more than the first given threshold, is the mesh
It records item setting and deletes mark;
Index node deletes subelement, is configured as when CPU usage is less than the second given threshold, according to the catalogue
The deletion mark of item, deletes the corresponding index node of the file to be deleted, and first given threshold is greater than described second and sets
Determine threshold value.
Optionally, the device further include:
Cancel command reception module, is configured as receiving the cancellation to the mark of subitem unsuppressible-suppression possessed by the catalogue
Instruction;
Unsuppressible-suppression mark cancels module, is configured as being instructed according to the cancellation, in the index node of the catalogue
Cancel the subitem unsuppressible-suppression mark;
Subitem delete command receiving module is configured as receiving the delete command to the first order subitem of the catalogue;
Second removing module is configured as not wrapped in the index node for determining the catalogue according to the delete command
When unsuppressible-suppression containing subitem identifies, the letter of the first order subitem and the first order subitem in the index node is deleted
Breath, and delete the corresponding index node of the first order subitem.
Optionally, the subitem unsuppressible-suppression is identified as extended attribute.
Optionally, the first order subitem includes file or folder.
According to the third aspect of an embodiment of the present disclosure, a kind of server is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
The mark setting instruction of subitem unsuppressible-suppression is received, the subitem unsuppressible-suppression mark setting instruction includes son to be placed
The catalogue of item unsuppressible-suppression mark;
Setting instruction is identified according to the subitem unsuppressible-suppression, is that subitem unsuppressible-suppression is arranged in the index node of the catalogue
Mark, to prevent the first order subitem of the catalogue from accidentally being deleted.
After subitem unsuppressible-suppression is set for the index node of the catalogue and is identified, further includes:
File deletion commands are received, the file deletion commands include the store path of file to be deleted;
According to the store path, the parent directory of the file to be deleted is determined;
According to the parent directory, the index node of the parent directory is obtained;
When in the index node comprising subitem unsuppressible-suppression mark, stop deleting the file to be deleted.
Further include:
When not including subitem unsuppressible-suppression mark in the index node, the file to be deleted is deleted.
It is described to delete the file to be deleted, comprising:
According to the title of the index node and the file to be deleted, the directory entry of the file to be deleted is determined;
According to the directory entry, the corresponding index node of the file to be deleted is determined;
The information of the file to be deleted and the file to be deleted in the corresponding index node of the parent directory is deleted,
And delete the corresponding index node of the file to be deleted.
It is described to delete the corresponding index node of the file to be deleted, comprising:
When current CPU usage is more than the first given threshold, mark is deleted for directory entry setting;
It when CPU usage is less than the second given threshold, is identified, is deleted described to be deleted according to the deletion of the directory entry
The corresponding index node of file, first given threshold are greater than second given threshold.
After subitem unsuppressible-suppression is set for the index node of the catalogue and is identified, further includes:
It receives and the cancellation that subitem unsuppressible-suppression possessed by the catalogue identifies is instructed;
It is instructed according to the cancellation, cancels the subitem unsuppressible-suppression mark in the index node of the catalogue;
Receive the delete command to the first order subitem of the catalogue;
According to the delete command, when not including subitem unsuppressible-suppression mark in the index node for determining the catalogue,
The information of the first order subitem and the first order subitem in the index node is deleted, and deletes the first order subitem
Corresponding index node.
The subitem unsuppressible-suppression is identified as extended attribute.
Optionally, the first order subitem includes file or folder.
According to a fourth aspect of embodiments of the present disclosure, a kind of non-transitorycomputer readable storage medium is provided, when described
When instruction in storage medium is executed by the processor of mobile terminal, so that mobile terminal is able to carry out one of first aspect
The method for preventing file from accidentally deleting.
According to a fifth aspect of the embodiments of the present disclosure, a kind of computer program is provided, the method for the computer program includes
The step of method that one of first aspect prevents file from accidentally deleting.
The technical scheme provided by this disclosed embodiment can include the following benefits: by receiving subitem unsuppressible-suppression
Mark setting instructs, and includes the catalogue that subitem unsuppressible-suppression to be placed identifies in the mark setting instruction of subitem unsuppressible-suppression, according to
The subitem unsuppressible-suppression mark setting instruction is that the index node setting subitem unsuppressible-suppression of the catalogue identifies, so as to
To prevent the first order subitem of catalogue from accidentally being deleted, the file effectively prevented in network shared files storage system is accidentally deleted
It removes, improves the safety of the file in network shared files storage system.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of flow chart of method for preventing file from accidentally deleting shown according to an exemplary embodiment;
Fig. 2 is a kind of flow chart of method for preventing file from accidentally deleting shown according to an exemplary embodiment;
Fig. 3 is a kind of flow chart of method for preventing file from accidentally deleting shown according to an exemplary embodiment;
Fig. 4 is a kind of flow chart of method for preventing file from accidentally deleting shown according to an exemplary embodiment;
Fig. 5 is a kind of structural block diagram of device for preventing file from accidentally deleting shown according to an exemplary embodiment;
Fig. 6 is a kind of structural block diagram of server shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended
The example of device and method being described in detail in claims, some aspects of the invention are consistent.
Fig. 1 is a kind of flow chart of method for preventing file from accidentally deleting shown according to an exemplary embodiment, such as Fig. 1 institute
Show, the method for preventing file from accidentally deleting is for including the following steps in server.
In step s 11, the mark setting instruction of subitem unsuppressible-suppression, the subitem unsuppressible-suppression mark setting instruction are received
Catalogue including subitem unsuppressible-suppression to be placed mark.
In order to avoid the vital document in network shared files storage system is accidentally deleted, the first user can pass through network
The client input subitem unsuppressible-suppression mark setting instruction of shared file storage system, the client can not by the subitem
The server that mark is sent to network shared files storage system is deleted, server can receive the subitem of the first user not
Mark setting instruction can be deleted.Wherein, the first user can be the user of the setting permission with subitem unsuppressible-suppression mark.
In step s 12, setting instruction is identified according to the subitem unsuppressible-suppression, is that the index node of the catalogue is arranged
Subitem unsuppressible-suppression mark, to prevent the first order subitem of the catalogue from accidentally being deleted.
Wherein, index node (inode) is used to store the essential information of archives and catalogue, includes time, shelves name, user
And group etc..First order subitem can be file or folder, be also possible to catalogue file.
For file storage on hard disk, the minimum memory unit of hard disk is called sector (Sector).Each sector stores 512 words
It saves (being equivalent to 0.5KB).When operating system reads hard disk, disposably continuously read multiple sectors, i.e., it is disposable to read one
A block (block).This block being made of multiple sectors is the minimum unit of file access.File data is stored in block,
So also need the metamessage of one piece of regions store file, such as the size of the founder of file, the date created of file, file
Etc., the region of this store files metamessage is just called index node.Each file has corresponding index node, the inside
Contain some information related with this document.
Setting instruction is identified according to the subitem unsuppressible-suppression, determines the catalogue for needing to be arranged subitem unsuppressible-suppression mark,
According to the catalogue, the corresponding index node of the catalogue is found, is identified so that subitem unsuppressible-suppression be arranged for the index node, it should
All first order subitems of the corresponding catalogue of index node just will not be deleted accidentally, and other grade of subitem (such as second of the catalogue
Grade subitem and third level subitem etc.) it is not influenced by subitem unsuppressible-suppression mark then.When due to deleting file or folder, need
The relevant information that this document or file are removed from the index node of this document or the parent directory of file, therefore, in father
Subitem unsuppressible-suppression is arranged in the index node of catalogue to identify, when needing to delete this document or file, if parent directory
There is subitem unsuppressible-suppression mark in index node, then no longer execute the operation for deleting this document or file, so as to avoid accidentally
It deletes.
Wherein, subitem unsuppressible-suppression mark is chosen as extended attribute, and extended attribute (xattrs) provides a mechanism and uses
By " name/value " to file is for good and all associated with, existing file system is allowed to be able to support not provide in original design
Function.Title is a common character string, and is worth and then limits without what.Extended attribute is an attribute of linux system,
Subitem unsuppressible-suppression characteristic is arranged using extended attribute for the embodiment of the present disclosure, can be to avoid introducing new data, and is easy
Implement.
What the present exemplary embodiment provided prevents file from missing the method deleted, and passes through and receives the mark setting of subitem unsuppressible-suppression
Instruction, the catalogue including subitem unsuppressible-suppression to be placed mark in instruction is arranged in subitem unsuppressible-suppression mark, according to the subitem
Unsuppressible-suppression mark setting instruction is that the index node setting subitem unsuppressible-suppression of the catalogue identifies, so as to prevent mesh
The first order subitem of record is accidentally deleted, and the file effectively prevented in network shared files storage system is accidentally deleted, and is improved
The safety of file in network shared files storage system.
Fig. 2 is a kind of flow chart of method for preventing file from accidentally deleting shown according to an exemplary embodiment, such as Fig. 2 institute
Show, includes the following steps.
In the step s 21, the mark setting instruction of subitem unsuppressible-suppression, the subitem unsuppressible-suppression mark setting instruction are received
Catalogue including subitem unsuppressible-suppression to be placed mark.
The particular content of this step is identical as the particular content of step S11 in the above exemplary embodiments, here no longer
It repeats.
In step S22, setting instruction is identified according to the subitem unsuppressible-suppression, is that the index node of the catalogue is arranged
Subitem unsuppressible-suppression mark, to prevent the first order subitem of the catalogue from accidentally being deleted.
The particular content of this step is identical as the particular content of step S12 in the above exemplary embodiments, here no longer
It repeats.
In step S23, file deletion commands are received, the file deletion commands include the storage road of file to be deleted
Diameter.
User can by the client of network shared files storage system specify the file to be deleted, client according to
The operation at family determines the store path of file to be deleted, and generates file deletion commands, is sent to network shared files storage system
The server of system.Server receives the file deletion commands that client is sent and determines text to be deleted according to file deletion commands
The store path of part.Wherein, which can be above-mentioned first user, be also possible to other users.
In step s 24, according to the store path, the parent directory of the file to be deleted is determined.
Wherein, parent directory is the upper level catalogue of present position, and the parent directory of file to be deleted is file to be deleted
Upper level catalogue.
For example, the entitled filea of file to be deleted, the store path of file to be deleted is /dira/filea., then to
The parent directory for deleting file is dira.
In step s 25, according to the parent directory, the index node of the parent directory is obtained.
The corresponding file or folder of each catalogue in store path, and each file or folder have it is corresponding
Index node, so according to parent directory, it is available to arrive the corresponding index node of parent directory.
In step S26, when in the index node comprising subitem unsuppressible-suppression mark, stop deleting described to be deleted
File.
The embodiment of the present disclosure is identified by the way that subitem unsuppressible-suppression is arranged in the index node of parent directory, subitem is arranged not
Characteristic can be deleted, therefore, when in the corresponding index node of parent directory comprising subitem unsuppressible-suppression mark, then the of the parent directory
Level-one subitem unsuppressible-suppression does not execute the operation for deleting file to be deleted, that is, stop deleting file to be deleted.
For example, file to be deleted is dir1, store path is in dir111/dir11/dir1/file2, if dir1
It include extended attribute, the then equal unsuppressible-suppression of first order subitem of parent directory dir11, dir1 in the index node of parent directory dir11
Unsuppressible-suppression, if the subitem of dir11 further includes dir2, dir2 also unsuppressible-suppression.Comprising expanding in the index node of dir11
When opening up attribute, the deletion to second level subitem is not influenced, i.e., does not influence the deletion of file2, when deleting file2, needs to detect
Whether include extended attribute in the index node of dir1, if including extended attribute in the index node of dir1, cannot delete
File2 can delete file2 if not including extended attribute in the index node of dir1.
What the present exemplary embodiment provided prevents file from missing the method deleted, and by receiving file deletion commands, file is deleted
Except order includes the store path of file to be deleted, the parent directory of file to be deleted is determined according to store path, determines parent directory
Corresponding index node stops deleting file to be deleted, passes through detection when in index node comprising subitem unsuppressible-suppression mark
Whether the corresponding index node of parent directory includes subitem unsuppressible-suppression mark, to prevent the mistake of file from deleting, effectively prevents net
File in network shared file storage system is accidentally deleted, and the safety of the file in network shared files storage system is improved
Property.
Fig. 3 is a kind of flow chart of method for preventing file from accidentally deleting shown according to an exemplary embodiment, such as Fig. 2 institute
Show, this approach includes the following steps.
In step S31, the mark setting instruction of subitem unsuppressible-suppression, the subitem unsuppressible-suppression mark setting instruction are received
Catalogue including subitem unsuppressible-suppression to be placed mark.
The particular content of this step is identical as the particular content of step S11 in the above exemplary embodiments, here no longer
It repeats.
In step s 32, setting instruction is identified according to the subitem unsuppressible-suppression, is that the index node of the catalogue is arranged
Subitem unsuppressible-suppression mark, to prevent the first order subitem of the catalogue from accidentally being deleted.
The particular content of this step is identical as the particular content of step S12 in the above exemplary embodiments, here no longer
It repeats.
In step S33, file deletion commands are received, the file deletion commands include the storage road of file to be deleted
Diameter.
The particular content of this step is identical as the particular content of step S23 in the above exemplary embodiments, here no longer
It repeats.
In step S34, according to the store path, the parent directory of the file to be deleted is determined.
The particular content of this step is identical as the particular content of step S34 in the above exemplary embodiments, here no longer
It repeats.
In step s 35, according to the parent directory, the index node of the parent directory is obtained.
The particular content of this step is identical as the particular content of step S35 in the above exemplary embodiments, here no longer
It repeats.
In step S36, when in the index node comprising subitem unsuppressible-suppression mark, stop deleting described to be deleted
File.
The particular content of this step is identical as the particular content of step S36 in the above exemplary embodiments, here no longer
It repeats.
In step S37, when not including subitem unsuppressible-suppression mark in the index node, delete described wait delete
Except file.
Whether the embodiment of the present disclosure is by including that subitem unsuppressible-suppression identifies in the corresponding index node of parent directory, to identify
Whether the subitem of parent directory has unsuppressible-suppression characteristic, and subitem unsuppressible-suppression mark is not included in the corresponding index node of parent directory
When knowledge, determines that the subitem of parent directory does not have unsuppressible-suppression characteristic, then execute the operation for deleting file to be deleted.
It is optionally, described to delete the file to be deleted, comprising:
According to the title of the index node and the file to be deleted, the directory entry of the file to be deleted is determined;
According to the directory entry, the corresponding index node of the file to be deleted is determined;
The information of the file to be deleted and the file to be deleted in the corresponding index node of the parent directory is deleted,
And delete the corresponding index node of the file to be deleted.
Wherein, directory entry (dentry) is the link of some index node (inode) in Linux file system.This rope
Drawing node can be file, be also possible to catalogue.
The metadata information of file to be deleted is stored in the index node of parent directory, therefore, according to file to be deleted
Title inquires the directory entry of file to be deleted in the index node of the parent directory of file to be deleted, due to the mesh of file to be deleted
Record item is directed toward the index node of file to be deleted, then it is corresponding to navigate to file to be deleted according to the directory entry of file to be deleted
Index node, delete operation is carried out to the index node, while deleting file to be deleted and file to be deleted in its parent directory
Metadata information in corresponding index node.
It is optionally, described to delete the corresponding index node of the file to be deleted, comprising:
When current CPU usage is more than the first given threshold, mark is deleted for directory entry setting;
It when CPU usage is less than the second given threshold, is identified, is deleted described to be deleted according to the deletion of the directory entry
The corresponding index node of file, first given threshold are greater than second given threshold.
Wherein, CPU usage is more than that the first given threshold indicates that CPU is in a busy state, and CPU usage is set less than second
Determining threshold value indicates that CPU is in idle condition, and the first given threshold is greater than the second given threshold, and such as the first given threshold can be
70%, the second given threshold can be 30%.It deletes mark and is deleted for identifying delay.
Need to expend more CPU due to deleting index node, when to delete file to be deleted, at current CPU
In busy state, then mark can be deleted for the corresponding directory entry setting of file to be deleted, and association has the mesh for deleting mark
Item and corresponding index node are recorded, in the CPU free time, there will be index node associated by the directory entry deleting and identify from hard disk
Upper deletion.It is deleted by delay, can occupy the request of user caused by more CPU to avoid deletion file cannot be rung in time
It answers.
What the present exemplary embodiment provided prevents file from missing the method deleted, and passes through the index of the parent directory of file to be deleted
When in node comprising subitem unsuppressible-suppression mark, stop deleting file to be deleted, and the index of the parent directory in file to be deleted
When not including subitem unsuppressible-suppression mark in node, file to be deleted is deleted, effectively prevents network shared files storage system
The mistake of file is deleted in system, improves the safety of the file in network shared files storage system.
Fig. 4 is a kind of flow chart of method for preventing file from accidentally deleting shown according to an exemplary embodiment, such as Fig. 4 institute
Show, this approach includes the following steps.
In step S41, the mark setting instruction of subitem unsuppressible-suppression, the subitem unsuppressible-suppression mark setting instruction are received
Catalogue including subitem unsuppressible-suppression to be placed mark.
The particular content of this step is identical as the particular content of step S11 in the above exemplary embodiments, here no longer
It repeats.
In step S42, setting instruction is identified according to the subitem unsuppressible-suppression, is that the index node of the catalogue is arranged
Subitem unsuppressible-suppression mark, to prevent the first order subitem of the catalogue from accidentally being deleted.
The particular content of this step is identical as the particular content of step S12 in the above exemplary embodiments, here no longer
It repeats.
In step S43, receives and the cancellation that subitem unsuppressible-suppression possessed by the catalogue identifies is instructed.
If second user does want to delete the first order subitem under the catalogue, firstly the need of the cancellation first order
The unsuppressible-suppression characteristic of subitem deletes the mark of subitem unsuppressible-suppression possessed by the parent directory, therefore, user can pass through
The client input of network shared files storage system instructs the cancellation that subitem unsuppressible-suppression possessed by the catalogue identifies,
Described cancel is instructed the server for being sent to network shared files storage system by the client of network shared files storage system.
Wherein, second user can be first and use outdoor user, be also possible to the first user.
In step S44, instructed according to the cancellation, cancelling the subitem in the index node of the catalogue can not delete
Except mark.
The server of network shared files storage system can determine whether second user has according to the mark of second user
The cancellation permission for thering is subitem unsuppressible-suppression to identify.When second user has and cancels permission, cancel son in the index node of catalogue
Item unsuppressible-suppression mark, so that second user or other users can delete the mesh after cancelling subitem unsuppressible-suppression mark
The first order subitem of record.If second user inputs the delete command to the first order subitem of the catalogue, server determines should
Do not include subitem unsuppressible-suppression in the index node of catalogue to identify, then deletes the first order subitem.
In step S45, the delete command to the first order subitem of the catalogue is received.
In step S46, according to the delete command, not including subitem in the index node for determining the catalogue can not
When deleting mark, the information of the first order subitem and the first order subitem in the index node is deleted, and delete institute
State the corresponding index node of first order subitem.
When receiving delete command of the second user to the first order subitem of catalogue, it is necessary first to determine the catalogue
Whether identify comprising subitem unsuppressible-suppression in index node, identified if not including subitem unsuppressible-suppression, deletes first order
Item and information of the first order subitem in the index node of the catalogue, while deleting the corresponding index node of first order subitem.?
It, can be according to the index node of the catalogue and the title of first order subitem, really when deleting the corresponding index node of first order subitem
The directory entry for determining first order subitem determines the corresponding index node of first order subitem according to the directory entry, deletes first order
The corresponding index node of item.If current CPU usage is more than first in the corresponding index node of deletion first order subitem
Given threshold then deletes mark for the directory entry setting of the first order subitem, when CPU usage is less than the second given threshold,
It is identified according to the deletion of directory entry, deletes the corresponding index node of first order subitem;If corresponding deleting first order subitem
Index node when, current CPU usage is not above the first given threshold, then deletes the corresponding index of first order subitem
Node.Wherein, the first given threshold is greater than the second given threshold.
What the present exemplary embodiment provided prevents file from missing the method deleted, on the basis of the above exemplary embodiments,
The cancellation that subitem unsuppressible-suppression possessed by the catalogue identifies is instructed by receiving, the index in catalogue is instructed according to cancellation
Cancel the subitem unsuppressible-suppression mark in node to delete when receiving the delete command to the catalogue first order subitem
The information of first order subitem and first order subitem in the index node of the catalogue, and delete the corresponding rope of first order subitem
Draw node, to realize the deletion mode to the first order subitem for being provided with subitem unsuppressible-suppression mark, it is necessary first to cancel
The corresponding subitem unsuppressible-suppression characteristic of the first order subitem is deleted so as to avoid the mistake to file.
Fig. 5 is a kind of structural block diagram of device for preventing file from accidentally deleting shown according to an exemplary embodiment.Reference
Fig. 5, the device include setting command reception module 51 and unsuppressible-suppression identify and arrange module 52.
The setting command reception module 51 is configured as receiving the mark setting instruction of subitem unsuppressible-suppression, and the subitem can not
Delete the catalogue that mark setting instruction includes subitem unsuppressible-suppression to be placed mark;
The unsuppressible-suppression identify and arrange module 52 is configured as identifying setting instruction according to the subitem unsuppressible-suppression, for institute
The index node setting subitem unsuppressible-suppression for stating catalogue identifies, to prevent the first order subitem of the catalogue from accidentally being deleted.
Delete command receiving module is configured as identifying it in the index node setting subitem unsuppressible-suppression for the catalogue
Afterwards, file deletion commands are received, the file deletion commands include the store path of file to be deleted;
Parent directory determining module is configured as determining the parent directory of the file to be deleted according to the store path;
Index node obtains module, is configured as obtaining the index node of the parent directory according to the parent directory;
Stopping modular is deleted, when being configured as in the index node comprising subitem unsuppressible-suppression mark, stops deleting
The file to be deleted.
Optionally, further includes:
First removing module is deleted when being configured as not including subitem unsuppressible-suppression mark in the index node
Except the file to be deleted.
Optionally, first removing module includes:
Directory entry determination unit is configured as determining institute according to the title of the index node and the file to be deleted
State the directory entry of file to be deleted;
Index node determination unit is configured as determining the corresponding index of the file to be deleted according to the directory entry
Node;
Unit is deleted, is configured as deleting the file to be deleted and the file to be deleted is corresponding in the parent directory
Information in index node, and delete the corresponding index node of the file to be deleted.
Optionally, the deletion unit includes:
Mark setting subelement is deleted, is configured as when CPU usage is more than the first given threshold, is the directory entry
Mark is deleted in setting;
Index node deletes subelement, is configured as when CPU usage is less than the second given threshold, according to the catalogue
The deletion mark of item, deletes the corresponding index node of the file to be deleted, and first given threshold is greater than described second and sets
Determine threshold value.
Optionally, the device further include:
Cancel command reception module, is configured as receiving the cancellation to the mark of subitem unsuppressible-suppression possessed by the catalogue
Instruction;
Unsuppressible-suppression mark cancels module, is configured as being instructed according to the cancellation, in the index node of the catalogue
Cancel the subitem unsuppressible-suppression mark;
Subitem delete command receiving module is configured as receiving the delete command to the first order subitem of the catalogue;
Second removing module is configured as not wrapped in the index node for determining the catalogue according to the delete command
When unsuppressible-suppression containing subitem identifies, the letter of the first order subitem and the first order subitem in the index node is deleted
Breath, and delete the corresponding index node of the first order subitem.
Optionally, the subitem unsuppressible-suppression is identified as extended attribute.
Optionally, the first order subitem includes file or folder.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method
Embodiment in be described in detail, no detailed explanation will be given here.
Fig. 6 is a kind of structural block diagram of server shown according to an exemplary embodiment.Referring to Fig. 6, server 600 is wrapped
Processing component 622 is included, further comprises one or more processors, and the memory resource as representated by memory 632,
It can be by the instruction of the execution of processing component 622, such as application program for storing.The application program stored in memory 632 can
With include it is one or more each correspond to one group of instruction module.In addition, processing component 622 is configured as executing
Instruction, to execute the above method.
Server 600 can also include that a power supply module 626 be configured as the power management of execute server 600, and one
A wired or wireless network interface 650 is configured as server 600 being connected to network and input and output (I/O) interface
658.Server 600 can be operated based on the operating system for being stored in memory 632, such as Windows ServerTM, Mac
OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Memory 632 is configured as storing various types of data to support the operation in server 600.These data
Example includes the instruction of any application or method for operating on server 600.Memory 632 can be by any class
The volatibility or non-volatile memory device or their combination of type are realized, such as static random access memory (SRAM), electricity
Erasable Programmable Read Only Memory EPROM (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory
(PROM), read-only memory (ROM), magnetic memory, flash memory, disk or CD.
Power supply module 626 provides electric power for the various assemblies of server 600.Power supply module 626 may include power management
System, one or more power supplys and other with for server 600 generate, manage, and distribute the associated component of electric power.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided
It such as include the memory 632 of instruction, above-metioned instruction can be executed by the processing component 622 of server 600 to complete the above method.Example
Such as, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, soft
Disk and optical data storage devices etc..
In the exemplary embodiment, a kind of computer program is additionally provided, including one or more instructs, this or more
Item instruction can be executed by the processing component 622 of server 600, to complete the above-mentioned method for preventing file from accidentally deleting.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or
Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the disclosure
Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following
Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.
Claims (10)
1. a kind of method for preventing file from accidentally deleting characterized by comprising
It receives subitem unsuppressible-suppression and identifies and instruction is set, the subitem unsuppressible-suppression mark setting is instructed including subitem to be placed not
The catalogue of mark can be deleted;
Setting instruction is identified according to the subitem unsuppressible-suppression, is that subitem unsuppressible-suppression mark is arranged in the index node of the catalogue
Know, to prevent the first order subitem of the catalogue from accidentally being deleted.
2. the method according to claim 1, wherein subitem, which is arranged, in the index node for the catalogue to delete
After mark, further includes:
File deletion commands are received, the file deletion commands include the store path of file to be deleted;
According to the store path, the parent directory of the file to be deleted is determined;
According to the parent directory, the index node of the parent directory is obtained;
When in the index node comprising subitem unsuppressible-suppression mark, stop deleting the file to be deleted.
3. according to the method described in claim 2, it is characterized by further comprising:
When not including subitem unsuppressible-suppression mark in the index node, the file to be deleted is deleted.
4. according to the method described in claim 3, it is characterized in that, described delete the file to be deleted, comprising:
According to the title of the index node and the file to be deleted, the directory entry of the file to be deleted is determined;
According to the directory entry, the corresponding index node of the file to be deleted is determined;
The information of the file to be deleted and the file to be deleted in the corresponding index node of the parent directory is deleted, and is deleted
Except the corresponding index node of the file to be deleted.
5. according to the method described in claim 4, it is characterized in that, described delete the corresponding index section of the file to be deleted
Point, comprising:
When current CPU usage is more than the first given threshold, mark is deleted for directory entry setting;
It when CPU usage is less than the second given threshold, is identified according to the deletion of the directory entry, deletes the file to be deleted
Corresponding index node, first given threshold are greater than second given threshold.
6. the method according to claim 1, wherein subitem, which is arranged, in the index node for the catalogue to delete
After mark, further includes:
It receives and the cancellation that subitem unsuppressible-suppression possessed by the catalogue identifies is instructed;
It is instructed according to the cancellation, cancels the subitem unsuppressible-suppression mark in the index node of the catalogue;
Receive the delete command to the first order subitem of the catalogue;
According to the delete command, when not including subitem unsuppressible-suppression mark in the index node for determining the catalogue, delete
The information of the first order subitem and the first order subitem in the index node, and it is corresponding to delete the first order subitem
Index node.
7. method according to claim 1-6, which is characterized in that the subitem unsuppressible-suppression is identified as extension and belongs to
Property.
8. a kind of device for preventing file from accidentally deleting characterized by comprising
Command reception module is set, is configured as receiving the mark setting instruction of subitem unsuppressible-suppression, the subitem unsuppressible-suppression mark
Know the catalogue that setting instruction includes subitem unsuppressible-suppression to be placed mark;
Unsuppressible-suppression identify and arrange module is configured as identifying setting instruction according to the subitem unsuppressible-suppression, is the catalogue
Index node setting subitem unsuppressible-suppression identify, to prevent the first order subitem of the catalogue from accidentally being deleted.
9. a kind of server characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to executing the method for preventing file from accidentally deleting as claim 1-7 is described in any item.
10. a kind of non-transitorycomputer readable storage medium, which is characterized in that when the instruction in the storage medium is by moving
When the processor of terminal executes, so that mobile terminal is able to carry out a kind of method for preventing file from accidentally deleting, the method includes
Such as the described in any item steps of claim 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811556213.7A CN109828962B (en) | 2018-12-19 | 2018-12-19 | Method, device, server and storage medium for preventing file from being deleted by mistake |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811556213.7A CN109828962B (en) | 2018-12-19 | 2018-12-19 | Method, device, server and storage medium for preventing file from being deleted by mistake |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109828962A true CN109828962A (en) | 2019-05-31 |
CN109828962B CN109828962B (en) | 2022-06-24 |
Family
ID=66859651
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811556213.7A Active CN109828962B (en) | 2018-12-19 | 2018-12-19 | Method, device, server and storage medium for preventing file from being deleted by mistake |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109828962B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8924664B2 (en) * | 2012-12-13 | 2014-12-30 | Infinidat Ltd. | Logical object deletion |
CN104573093A (en) * | 2015-01-29 | 2015-04-29 | 广东欧珀移动通信有限公司 | Method and device for managing file catalog |
CN106354884A (en) * | 2016-10-09 | 2017-01-25 | 郑州云海信息技术有限公司 | Data object deleting method and device based on distributed file system |
CN106709034A (en) * | 2016-12-29 | 2017-05-24 | 广东欧珀移动通信有限公司 | File protection method and apparatus, and terminal |
CN107609027A (en) * | 2017-08-08 | 2018-01-19 | 捷开通讯(深圳)有限公司 | The anti-deleted marker position of file is set and prevents from deleting the method and device of file by mistake |
-
2018
- 2018-12-19 CN CN201811556213.7A patent/CN109828962B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8924664B2 (en) * | 2012-12-13 | 2014-12-30 | Infinidat Ltd. | Logical object deletion |
CN104573093A (en) * | 2015-01-29 | 2015-04-29 | 广东欧珀移动通信有限公司 | Method and device for managing file catalog |
CN106354884A (en) * | 2016-10-09 | 2017-01-25 | 郑州云海信息技术有限公司 | Data object deleting method and device based on distributed file system |
CN106709034A (en) * | 2016-12-29 | 2017-05-24 | 广东欧珀移动通信有限公司 | File protection method and apparatus, and terminal |
CN107609027A (en) * | 2017-08-08 | 2018-01-19 | 捷开通讯(深圳)有限公司 | The anti-deleted marker position of file is set and prevents from deleting the method and device of file by mistake |
Also Published As
Publication number | Publication date |
---|---|
CN109828962B (en) | 2022-06-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8578275B2 (en) | Application recommendation | |
Pehlivan et al. | The analysis of feature selection methods and classification algorithms in permission based Android malware detection | |
US20160292445A1 (en) | Context-based data classification | |
US11314498B2 (en) | System and method for downgrading applications | |
US20120259849A1 (en) | Determining file ownership of active and inactive files based on file access history | |
JP2014010465A (en) | Method for selecting storage cloud for storing entity file from two or more storage cloud and computer and computer program | |
US20110087644A1 (en) | Enterprise node rank engine | |
US9286307B2 (en) | Document management apparatus improved in efficiency of deletion of files, method of controlling the same, and storage medium | |
JP5542859B2 (en) | Log management apparatus, log storage method, log search method, and program | |
CN105808633A (en) | Data archiving method and system | |
CN104049968A (en) | Metadata-driven version management service in pervasive environment | |
WO2016110203A1 (en) | File path storing and local file accessing method and device | |
JPWO2014181541A1 (en) | Information processing apparatus and anonymity verification method for verifying anonymity | |
CN109766044A (en) | Virtual folder management method, device and storage medium | |
KR101512296B1 (en) | File associated with application processing terminal and processing method of file associated with application | |
KR20220012394A (en) | Method and apparatus for managing storage space in an electronic device using context data and user profile data | |
JP3840508B1 (en) | Information collection software management system, management server and management program | |
CN109828962A (en) | Method, apparatus, server and the storage medium for preventing file from accidentally deleting | |
CN103853580A (en) | Methods and systems for conditionally refreshing workarea user interfaces | |
US10642941B2 (en) | System and method for pipeline management of artifacts | |
CN104572945B (en) | A kind of file search method and device based on cloud storage space | |
CN110781438A (en) | Page display method and device | |
WO2020005633A1 (en) | Download management | |
CN109858278A (en) | File permission setting method, device, computer equipment and storage medium | |
US20160170717A1 (en) | Association of program code and application features |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |