Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.computer > #11294

Re: Folder deletion

From Paul <nospam@needed.invalid>
Newsgroups alt.computer
Subject Re: Folder deletion
Date 2019-11-06 02:10 -0500
Organization A noiseless patient Spider
Message-ID <qptrlo$5gt$1@dont-email.me> (permalink)
References <EptwF.59071$Ko9.8043@fx48.iad>

Show all headers | View raw


Robert Baer wrote:
>   In my Toshiba 1 Terror-Byte drive, there are 3 major recovery folders: 
> Old Data, Old Data 2, Old Data 3.
> 
>   Each one has a passel of folders, roughly 30 and each of those may 
> have up to about 1000 files of a given type ("Office2007 Excel Document" 
> had *.xls files).
> 
>  In effect, i processed the files in "Old Data", picking out those of 
> use and discarding the duplicates.
> 
>   Then moved the renamed good files to other meaningful-named folders.
>   Result is an empty folder.
> 
>   Cannot delete it; get message "it is being used by another person or 
> program" which is not true.
> 
>   So, how do i go about "releasing" the folder so i can delete it?
> 
>   Thanks.

You need a reliable directory listing application.

Unfortunately, there is no such thing.

Even icacls, the program used to dump permissions
into a text file for restoration later, it won't list
reparse points and it steps over those.

The Microsoft utility "nfi" from the year 2000 or so,
does a reasonable job on data-only drives. But it
doesn't list hardlinked files, such as the links between
WinSXS and System32 properly.

The program Everything.exe, a search utility, it has
a directory listing capability. But it too, succumbs to
permissions, so if the permissions on a folder are restrictive
enough (System Volume Information), it won't list the files
inside.

How can we tell a folder is empty ? Damn good question!

On Windows, if a file has a "." in front of the name,
that might render it invisible in File Explorer.
And there can be desktop.ini files which are
set to "invisible" attribute, but those probably
don't hurt anything.

When Everything.exe was first released, I think it
only scanned the $MFT and at that point in time, it
was immune to permissions problems. It could indeed
list everything. But by using the $MFT alone, there
was no opportunity to read folders $I30 structure,
and perhaps get info such as Modified Date and Size.
Later versions of the program, when they would stat()
the files to get their individual statistics, if
the permissions said "you can't read this", then
everything.exe throws away the entry in the output file.
Thus, the program is "blinded" by permissions.

*******

Having said all of this, remember that if File Explorer
has the folder open, or if you have a Command Prompt
open and you are CD'ed into that folder, that can
be sufficient to prevent deletion. Make sure
that the folder is not being accessed by any
process.

Sysinternals Process Explorer or Sysinternals Handle.exe,
can tell you when File Explorer is making a folder "busy".
But using your intuition, it's possible to close all
File Explorer windows and Command Prompt windows, and
"release" the handle.

*******

Since you're working with a data drive, use Everything.exe
anyway. Here is the syntax.

    Everything.exe -create-filelist C:\users\timmy\Downloads\out.txt  "D:"

https://www.voidtools.com/downloads/

    Portable ZIP x86 32-bit (extract from ZIP, then use it)

    https://www.voidtools.com/Everything-1.4.1.935.x86.zip

Wait about 30 seconds for the output file to stop growing.
The program runs a scan in the background and is a bit sneaky.

Filename,Size,Date Modified,Date Created,Attributes
"H:\board\IMG_0172.JPG",2277127,131869161580000000,131869144534531250,32

I can see my "board" directory has a file in it. A file
which is 2,227,127 bytes and was modified on 131869161580000000,
which is 11/17/2018  03:15:58.000 . I have my own filetime.exe
program, to convert Everything nanosecond-type stamps, into
regular date values.

******* filetime.c ********

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <Windows.h>
#include <WinBase.h>

int main(int argc, char *argv[])
{
    FILETIME timein;
    SYSTEMTIME stUTC, stLocal;
    DWORD dwRet;

    long long int arrgh;
    int conv1;

/* typedef struct _FILETIME {      = 131679807063691748;
	DWORD dwLowDateTime;         1D3D216 0x3C1F91E4
	DWORD dwHighDateTime;

    timein.dwLowDateTime  =  0x3C1F91E4;
    timein.dwHighDateTime =  0x01D3D216; */

    if (argc != 2) goto later;
    if ( (conv1 = sscanf(argv[1], "%I64d", &arrgh))  == 0) goto later;
    timein.dwLowDateTime  = (unsigned int) 0xFFFFFFFF & arrgh;
    timein.dwHighDateTime = (unsigned int) 0xFFFFFFFF & (arrgh >> 32);

    printf("%X %X\n", timein.dwHighDateTime, timein.dwLowDateTime);

    FileTimeToSystemTime(&timein, &stUTC);

    SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);

    printf("%02d/%02d/%d  %02d:%02d:%02d.%03d\n",
            stLocal.wMonth, stLocal.wDay, stLocal.wYear,
            stLocal.wHour, stLocal.wMinute,
            stLocal.wSecond, stLocal.wMilliseconds);

later:   return 0;
}
******* filetime.c ********

So that's how I can read Everything.exe timestamps in
a file like that.

filetime 131869161580000000

     Paul

Back to alt.computer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Folder deletion Robert Baer <robertbaer@localnet.com> - 2019-11-05 22:06 -0800
  Re: Folder deletion Paul <nospam@needed.invalid> - 2019-11-06 02:10 -0500
    Re: Folder deletion Robert Baer <robertbaer@localnet.com> - 2019-11-06 20:38 -0800
      Re: Folder deletion Paul <nospam@needed.invalid> - 2019-11-07 00:07 -0500

csiph-web