|
2013-09-27
| ||
| 08:54 | • Closed ticket [226413ffff]: file delete cannot delete nonempty directories on Wi... artifact: cdfeea5350 user: dkf | |
|
2001-08-25
| ||
| 01:10 | • Ticket [226413ffff]: 4 changes artifact: d93c67b973 user: hobbs | |
|
2001-08-24
| ||
| 23:50 | • Ticket [226413ffff]: 5 changes artifact: 7a82817bbb user: vincentdarley | |
| 04:49 | • Ticket [226413ffff]: 5 changes artifact: a9cdc1df28 user: andreas_kupries | |
|
2001-02-17
| ||
| 02:53 | • Ticket [226413ffff]: 4 changes artifact: 375d0dc1f2 user: jhilbert | |
| 02:51 | • Ticket [226413ffff]: 4 changes artifact: 88c51b2a93 user: jhilbert | |
|
2001-02-07
| ||
| 22:59 | • Ticket [226413ffff]: 1 change artifact: a6eed35c18 user: dkf | |
|
2001-01-27
| ||
| 22:46 | • Ticket [226413ffff]: 6 changes artifact: e498e83e84 user: dkf | |
|
2000-12-20
| ||
| 02:04 | • New ticket [226413ffff]. artifact: b0ab4376d6 user: jhilbert | |
file delete cannot delete nonempty directories on Windows 98
Closed / Out of Date226413ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 13 years ago
Descriptionplain2000-12-20 02:04:59
"file delete -force" deletes nonempty directories on Windows NT, but not on Windows 98. The following script demonstrates. im4u is a Windows 98 machine, annas_nt is an NT 4.0 machine % file mkdir //im4u/c-drive/testdir % open //im4u/c-drive/testdir/jon w fileabd120 % close fileabd120 % glob //im4u/c-drive/testdir/* //im4u/c-drive/testdir/jon % file delete //im4u/c-drive/testdir error deleting "//im4u/c-drive/testdir": permission denied % file delete -force -- //im4u/c-drive/testdir error deleting "//im4u/c-drive/testdir": permission denied % file delete //im4u/c-drive/testdir/jon % file delete //im4u/c-drive/testdir % glob //im4u/c-drive/testdir/* no files matched glob pattern "//im4u/c-drive/testdir/*" % glob //im4u/c-drive/test* no files matched glob pattern "//im4u/c-drive/test*" % file mkdir //annas_nt/c-drive/testdir % open //annas_nt/c-drive/testdir/jon w fileabe3a0 % close fileabe3a0 % file delete //annas_nt/c-drive/testdir error deleting "//annas_nt/c-drive/testdir": directory not empty % file delete -force -- //annas_nt/c-drive/testdir % glob //annas_nt/c-drive/test* no files matched glob pattern "//annas_nt/c-drive/test*"
dkfplain2001-01-27 22:46:17
It obviously depends on something fairly subtle, since the following worked as advertised for me with 8.3.0:
% cd /windows/temp
% file mkdir foo
% cd foo
% close [open bar w]
% cd ..
% list [catch {file delete foo} msg] $msg
1 {error deleting "foo": directory not empty}
% list [catch {file delete -force foo} msg] $msg
0 {}
dkf Ticket [226413ffff]: 1 change
[History diff]2001-02-07 22:59:29
jhilbertplain2001-02-17 02:51:53
I believe another symptom I have discovered is relevant. The TclpStat() routine returns different results depending on whether it is running on W98 or W2000/NT, depending on what type of pathname is passed to it. Apparently W98 does not perform as expected by TclpStat() if the pathname is the root drive of a volume shared on another machine (e.g. \\server\volume). This causes several parts of the Tcl file command to misbehave, including "file delete" as mentioned in the original bug, and "file isdirectory" and "file mkdir".
The following simple C program can be used to show the difference. Compile and run it as a console app, passing a filename as a single argument. It returns the results of a FindFirstFile() call and a GetFileAttributes() call on the filename.
#include <windows.h>
#include <stdio.h>
#include <sys/stat.h>
int main(int argc, char* argv[])
{
if (argc>1) {
DWORD attr = GetFileAttributes(argv[1]);
printf("flag for directory is %08X",FILE_ATTRIBUTE_DIRECTORY);
printf("\nattributes from GetFileAttributes(%s) : %08X",argv[1],attr);
WIN32_FIND_DATA findData;
HANDLE handle = FindFirstFile(argv[1],&findData);
if (handle != INVALID_HANDLE_VALUE) {
printf("\nattributes from FindFirstFile(%s): %08X",argv[1], findData.dwFileAttributes);
} else {
printf("\nFindFirstFile(%s) returned: %08X",argv[1],(DWORD)handle);
}
return 0;
}
printf("usage: %s <filename>",argv[0]);
return 1;
}
jhilbertplain2001-02-17 02:53:58
BTW, the symptom I describe in my Feb-16 comment appears to be directly relevant to the symptom described in bug #119351 as well.
andreas_kupriesplain2001-08-24 04:49:32
Logged In: YES user_id=75003 SF renumbering dance. He refers to #219351.
vincentdarleyplain2001-08-24 23:50:59
Logged In: YES user_id=32170 I don't have Win98 to test on, nor am I familiar with Win32 guts to be able to resolve this.
hobbsplain2001-08-25 01:10:15
Logged In: YES user_id=72656 This worked just fine for me testing from a Win98 and WinME box to the Win98 share, but on Win2K it does return the problem. I'm not sure what the best way to work around that would be.
dkfhtml2013-09-27 08:54:22
Win98 long obsolete; all current versions of Windows are based on NT, and currently supported Tcl versions do not support Win98 at all.
Log in (anonymous is fine) to add a comment.