EldoS | Feel safer!

Software components for data protection, secure storage and transfer

OnDelete event is not fired for folder.

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#20279
Posted: 05/31/2012 10:31:10
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Hi, I am trying to delete folder from my virtual disk and receiving dialog with question want or no, after press Yes, can see deleting progress bar, but folder is present.
So, after debugging this problem I've found that my handler does not receive OnDelete event.
Tried to analyze list of operations using sysinternals Process Monitor received next log:

Quote
6:01:28.2349846 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:28.3779938 PM Explorer.EXE 2068 CreateFile S:\ SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:28.3780402 PM Explorer.EXE 2068 CreateFile S:\ IS DIRECTORY Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Complete If Oplocked, Attributes: n/a, ShareMode: Read, AllocationSize: n/a
6:01:28.3785395 PM Explorer.EXE 2068 FileSystemControl S:\ INVALID DEVICE REQUEST Control: FSCTL_LMR_QUERY_DEBUG_INFO
6:01:28.3785685 PM Explorer.EXE 2068 QueryFullSizeInformationVolume S:\ SUCCESS TotalAllocationUnits: 33,554,432, CallerAvailableAllocationUnits: 33,554,432, ActualAvailableAllocationUnits: 33,554,432, SectorsPerAllocationUnit: 1, BytesPerSector: 512
6:01:30.9360401 PM Explorer.EXE 2068 CloseFile S:\ SUCCESS
6:01:30.9362778 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\ SUCCESS
6:01:32.0410494 PM Explorer.EXE 2068 QueryOpen S:\vmuser\New folder\hijnjmkmokm FAST IO DISALLOWED
6:01:32.6923526 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder\hijnjmkmokm SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:33.7948289 PM Explorer.EXE 2068 QueryNetworkOpenInformationFile S:\vmuser\New folder\hijnjmkmokm SUCCESS CreationTime: 5/31/2012 5:53:34 PM, LastAccessTime: 5/31/2012 5:53:34 PM, LastWriteTime: 5/31/2012 5:53:34 PM, ChangeTime: 1/1/1601 3:00:00 AM, AllocationSize: 1/1/1601 3:00:00 AM, EndOfFile: 1/1/1601 3:00:00 AM, FileAttributes: D
6:01:33.7948455 PM Explorer.EXE 2068 CloseFile S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:33.7948899 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:36.5308524 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder\hijnjmkmokm SUCCESS Desired Access: Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:37.8509367 PM Explorer.EXE 2068 QuerySecurityFile S:\vmuser\New folder\hijnjmkmokm INVALID DEVICE REQUEST Information: Owner, DACL
6:01:37.8509649 PM Explorer.EXE 2068 QuerySecurityFile S:\vmuser\New folder\hijnjmkmokm INVALID DEVICE REQUEST Information: Owner, DACL
6:01:37.8509823 PM Explorer.EXE 2068 CloseFile S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:37.8510284 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:39.5233862 PM Explorer.EXE 2068 QueryOpen S:\vmuser\New folder\hijnjmkmokm FAST IO DISALLOWED
6:01:39.9241389 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder\hijnjmkmokm SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:41.6870786 PM Explorer.EXE 2068 QueryBasicInformationFile S:\vmuser\New folder\hijnjmkmokm SUCCESS CreationTime: 5/31/2012 5:53:34 PM, LastAccessTime: 5/31/2012 5:53:34 PM, LastWriteTime: 5/31/2012 5:53:34 PM, ChangeTime: 1/1/1601 3:00:00 AM, FileAttributes: D
6:01:41.6870948 PM Explorer.EXE 2068 CloseFile S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:41.6871297 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:43.1765899 PM Explorer.EXE 2068 QueryOpen S:\vmuser\New folder\hijnjmkmokm FAST IO DISALLOWED
6:01:43.6957724 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder\hijnjmkmokm SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:44.2318046 PM Explorer.EXE 2068 QueryBasicInformationFile S:\vmuser\New folder\hijnjmkmokm SUCCESS CreationTime: 5/31/2012 5:53:34 PM, LastAccessTime: 5/31/2012 5:53:34 PM, LastWriteTime: 5/31/2012 5:53:34 PM, ChangeTime: 1/1/1601 3:00:00 AM, FileAttributes: D
6:01:44.2318212 PM Explorer.EXE 2068 CloseFile S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:44.2318677 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:44.2897702 PM Explorer.EXE 2068 CloseFile S:\vmuser\New folder SUCCESS
6:01:44.2898171 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder SUCCESS
6:01:44.2913492 PM Explorer.EXE 2068 CloseFile S:\vmuser\New folder SUCCESS
6:01:44.2913836 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder SUCCESS
6:01:46.3162071 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder\hijnjmkmokm SUCCESS Desired Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:47.2955736 PM Explorer.EXE 2068 QueryAttributeTagFile S:\vmuser\New folder\hijnjmkmokm SUCCESS Attributes: D, ReparseTag: 0x0
6:01:47.2955977 PM Explorer.EXE 2068 SetDispositionInformationFile S:\vmuser\New folder\hijnjmkmokm NOT EMPTY Delete: True
6:01:47.9757471 PM Explorer.EXE 2068 CloseFile S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:47.9757882 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:50.1499932 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder\hijnjmkmokm SUCCESS Desired Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:51.2217862 PM Explorer.EXE 2068 QueryAttributeTagFile S:\vmuser\New folder\hijnjmkmokm SUCCESS Attributes: D, ReparseTag: 0x0
6:01:51.2218111 PM Explorer.EXE 2068 SetDispositionInformationFile S:\vmuser\New folder\hijnjmkmokm NOT EMPTY Delete: True
6:01:52.3720011 PM Explorer.EXE 2068 CloseFile S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:52.3720667 PM Explorer.EXE 2068 IRP_MJ_CLOSE S:\vmuser\New folder\hijnjmkmokm SUCCESS
6:01:52.5250984 PM Explorer.EXE 2068 CreateFile S: SUCCESS Desired Access: Generic Read/Write, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened
6:01:53.2298144 PM Explorer.EXE 2068 FlushBuffersFile S: SUCCESS
6:01:53.2304377 PM Explorer.EXE 2068 CloseFile S: SUCCESS
6:01:53.2304808 PM Explorer.EXE 2068 IRP_MJ_CLOSE S: SUCCESS
6:01:53.2358228 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder SUCCESS Desired Access: Read Data/List Directory, Read Attributes, Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:54.1016053 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder IS DIRECTORY Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Complete If Oplocked, Attributes: n/a, ShareMode: Read, AllocationSize: n/a
6:01:54.4494581 PM Explorer.EXE 2068 QueryBasicInformationFile S:\vmuser\New folder SUCCESS CreationTime: 5/31/2012 5:16:47 PM, LastAccessTime: 5/31/2012 5:16:47 PM, LastWriteTime: 5/31/2012 5:16:47 PM, ChangeTime: 1/1/1601 3:00:00 AM, FileAttributes: D
6:01:54.4495432 PM Explorer.EXE 2068 NotifyChangeDirectory S:\vmuser\New folder Filter: FILE_NOTIFY_CHANGE_DIR_NAME
6:01:54.4539220 PM svchost.exe 628 QueryDeviceRelations S:\vmuser\New folder SUCCESS
6:01:55.0972007 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder SUCCESS Desired Access: Read Data/List Directory, Read Attributes, Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
6:01:55.9141056 PM Explorer.EXE 2068 CreateFile S:\vmuser\New folder IS DIRECTORY Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Complete If Oplocked, Attributes: n/a, ShareMode: Read, AllocationSize: n/a
6:01:55.9143015 PM Explorer.EXE 2068 QueryBasicInformationFile S:\vmuser\New folder SUCCESS CreationTime: 5/31/2012 5:16:47 PM, LastAccessTime: 5/31/2012 5:16:47 PM, LastWriteTime: 5/31/2012 5:16:47 PM, ChangeTime: 1/1/1601 3:00:00 AM, FileAttributes: D
6:01:55.9143911 PM Explorer.EXE 2068 NotifyChangeDirectory S:\vmuser\New folder Filter: FILE_NOTIFY_CHANGE_FILE_NAME, FILE_NOTIFY_CHANGE_ATTRIBUTES, FILE_NOTIFY_CHANGE_LAST_WRITE
6:01:55.9159436 PM svchost.exe 628 QueryDeviceRelations S:\vmuser\New folder SUCCESS


This log just after press "Yes" button on deleting dialog.
For file all works good, and sequence of calling of method is
Code
OnCanBeDeleted->OnDelete
.
I think that there is some problem in attributes of folder, but what kind of attributes I did not find, Can you help me?
Thanks
#20280
Posted: 05/31/2012 11:47:07
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Found that is happened if
Code
onIsDirectoryEmpty set isEmpty to false
, So, next question how to delete folder with files and folders?

BTW, variant is always set
Code
isEmty
to true not acceptable, but it works.
#20281
Posted: 05/31/2012 12:24:13
by Eugene Mayevski (EldoS Corp.)

This is application's job to delete files in the directory before deleting the directory itself. If you try to delete the directory on FAT or NTFS using Windows API, you will face the same problem - you would need to clear that directory prior to deleting it.


Sincerely yours
Eugene Mayevski
#20282
Posted: 05/31/2012 14:22:35
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Yes, I see, but how can I clear folder, if I do not know that delete event is occured for some folder?
Thanks
#20285
Posted: 05/31/2012 23:33:24
by Eugene Mayevski (EldoS Corp.)

You should not clear a folder. It's application's job.


Sincerely yours
Eugene Mayevski
#20287
Posted: 06/01/2012 04:21:13
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

OK, Thanks, done.
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 1955 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!