Files disappear in Explorer when DEL fails

May 20, 2008
11,400
99
Syracuse, NY, USA
I gave the command "del *.txt" in my temp folder and got
Code:
del *.txt
Deleting T:\FXSAPIDebugLogFile.txt
TCC: (Sys) The process cannot access the file because it is being used by another process.
"T:\FXSAPIDebugLogFile.txt"
Deleting T:\FXSTIFFDebugLogFile.txt
TCC: (Sys) The process cannot access the file because it is being used by another process.
"T:\FXSTIFFDebugLogFile.txt"
    0 files deleted      2 failed
I was watching an Explorer window and they disappeared. They weren't really deleted because a refresh (F5) of the Explorer window brought them back.

When I try it with CMD I get the same error messages and the files DO NOT disappear from the Explorer window! Likewise with TCSH and PowerShell ... error messages and the files DO NOT disappear from the Explorer window.

Is there any speculation why they disappear with TCC and not with other shells?
 
May 20, 2008
11,400
99
Syracuse, NY, USA
Hmmm! It doesn't happen when I do this (below). I get the expected "32" (file in use) and the file does not disappear from the Explorer window. Can you give me more information? I'd like to reproduce this one.
Code:
INT wmain ( INT argc, LPWSTR *argv )
{
    SHFILEOPSTRUCT fos = {NULL, FO_DELETE, L"t:\\FXSAPIDebugLogFile.txt\0", NULL, FOF_NO_UI, 0};
    wprintf(L"%d\n", SHFileOperation(&fos));
    return 0;
}
 
May 20, 2008
11,400
99
Syracuse, NY, USA
TCC is using different arguments.

Try it with _wremove() and DeleteFile() and see if it behaves the same way.

(I am not able to reproduce it here with Windows 8.)
I cannot reproduce the odd behavior at all with a test app ... not with SHFileOperation (as above), not with _wremove, not with DeleteFile. In a test app all three give the appropriate access/in_use error and the file does not disappear from the Explorer window.

You said TCC uses SHFileOperation. What args do you use?

But I am having a difficulty with SHFileOperation that I don't understand and can't get rid of. With the code I posted (plus a couple of printf/GetTickCounts) I see a (nearly exactly) 1 second delay during the execution of SHFileOperation. If the file can be (and is) deleted, there's no delay.

In a little bit of experimenting, all I've said above remains the same if I try SHFileOperation in a plugin (specifying the console window with all else the same).

So I still have two questions. Why does doing it with TCC cause the file to disappear from an Explorer window and why do get a 1 second delay from SGFileOperation?
 
May 20, 2008
11,400
99
Syracuse, NY, USA
FWIW, the same odd behavior (files not deleted disappearing from an Explorer window) also happens with v14 and does not happen with v13, v12, or v11.
And it happens when TCC is started with /IP /II /IS.
 
Similar threads
Thread starter Title Forum Replies Date
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
fpefpe How to? shortcuts and batch files Support 4
C v28 key files Support 2
J ffind does not find files Support 4
C duplicate files in multiple plugin sites Support 9
Dmitry L. Kobyakov Fixed The SETARRAY /R command works incorrectly with cyrillic files Support 2
S How to? Deinstalling TC/reinstating execution of bat files by cmd in Win7 Support 31
vefatica FFIND, temp files? ... not deleted? Support 0
R FUNCTION to count NUMBER of files matching a pattern and specific length/not length Support 4
vefatica Tmp files from in-process pipes not deleted Support 6
vefatica Finding files with alternate data streams? Support 4
rps Multi-column DIR /v not displaying all files. Support 5
D How to skip files in a fileset? Support 6
vefatica PIPEVIEW leaves TMP files Support 18
K "copy /z /w" command not deleting read-only files in destination Support 10
Jesse Heines "Taken" date for JPG and PNG files Support 4
O I cannot use links to .btm files Support 5
C How to? rename files with spaces Support 8
R How to? Append files in multiple subfolders using copy? Support 8
Joe Caverly "Functions" in cmd.exe batch files Support 6
S Batch files Calling Batch Files Support 2
vefatica Find Files/Text dialog: does it work? Support 0
Joe Caverly UNZIPping older .ZIP files Support 3
C Documentation default location for LOG files Support 21
P exit /b in batch files Support 7
P Labels in batch files: TCC vs CMD.exe Support 9
M ANSI is used to show files instead of OEM in version 17 to 19 ! Support 5
C 7Z files on forum? Support 0
x13 Problem listing repository files using DIR http(s)://... Support 8
B Can copy command concatenate multiple mp3 files Support 2
redwdc Copying files with spaces, commas, etc. Support 5
J New lexer for TCC batch files. Support 0
M How to? want to download a file from a website enumarate the links and download the files Support 2
keithg1964 TCC RT Install Files Support 1
P Fixed Rexx .cmd files no longer work in TCC 20 Support 3
thorntonpg Handling files with embedded spaces Support 1
WavSlave Fixed Unable to sort files by description in TCC v19 Support 2
P Files older - exist Support 1
D safe delete files command Support 10
P Copying files in subdirectories Support 9
C WAD VIEW print multiple files - switches fail Support 10
MikeBaas How to? SELECT: exclude files / display prompt Support 2
Phileosophos WAD Can't rename files in subfolders Support 1
nickles WAD del unable to delete files ending in "." Support 18
P Rename files with ampersand in the name Support 1
C Touch command — I Need to touch matching files in another directory. Support 5
S iftp copying pgp files from ftp is not working Support 11
M Fixed Cannot use the "Browse..." function in "Find files/text" dialogbox Support 2
fromano How to? Everything finding directories with 2 or more files in them Support 3
vefatica Empty .watch files saved Support 0

Similar threads