Re: cannot delete file: cannot read from the source file or disk
From: David Candy (david_at_mvps.org)
Date: 10/17/04
- Next message: Terry Pinnell: "Performance Monitor - odd behaviour"
- Previous message: Drew Tognola: "Re: downloading updates"
- In reply to: Yakimo: "Re: cannot delete file: cannot read from the source file or disk"
- Next in thread: Jim Byrd: "Re: cannot delete file: cannot read from the source file or disk"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 17 Oct 2004 19:37:56 +1000
The purpose of \\.\ is to allow paths of 32000 rather than 260. The file system is OS neutral. It will store files for any operating system. But operating system can only work with files that meet it's rules. And the only OS left in NT is the Windows sub system.
Win 2000 includes Windows and Posix. Posix can often delete files that windows can't (as it's legal names are completely different). See if you can use Posix to delete from a W2K machine..
File Name Conventions
Although each file system can have specific rules about the formation of individual components in a directory or file name, all file systems follow the same general conventions: a base file name and an optional extension, separated by a period. For example, the MS-DOS FAT file system supports 8 characters for the base file name and 3 characters for the extension. This is known as an 8.3 file name. The FAT file system and NTFS support file names that can be up to 255 characters long. This is known as a long file name. To get an MS-DOS file name given a long file name, use the GetShortPathName function. To get the full path of a file, use the GetFullPathName function.
Both file systems use the backslash (\) character to separate directory names and the file name when forming a path.
General rules for applications creating names for directories and files or processing names supplied by the user include the following:
a.. Use any character in the current code page for a name, but do not use a path separator, a character in the range 0 through 31, or any character explicitly disallowed by the file system. A name can contain characters in the extended character set (128–255).
b.. Use the backslash (\), the forward slash (/), or both to separate components in a path. No other character is acceptable as a path separator. Note that UNC names must adhere to the following format: \\server\share.
c.. Use a period (.) as a directory component in a path to represent the current directory.
d.. Use two consecutive periods (..) as a directory component in a path to represent the parent of the current directory.
e.. Use a period (.) to separate the base file name from the extension in a directory name or file name.
f.. Do not use the following characters in directory names or file names, because they are reserved:
< > : " / \ |
g.. Do not use device names, such as aux, con, lpt1, and prn, as file names or directory names.
h.. Process a path as a null-terminated string. The maximum length for a path, including a trailing backslash, is given by MAX_PATH.
The Unicode versions of several functions permit paths that exceed the MAX_PATH length if the path has the "\\?\" prefix. The "\\?\" tells the function to turn off path parsing. However, each component in the path cannot be more than MAX_PATH characters long. Use the "\\?\" prefix with paths for local storage devices and the "\\?\UNC\" prefix with paths having the Universal Naming Convention (UNC) format. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and "\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps".
i.. Do not assume case sensitivity. Consider names such as OSCAR, Oscar, and oscar to be the same.
j.. The following reserved words cannot be used as the name of a file: CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also, reserved words followed by an extension—for example, NUL.tx7—are invalid file names.
By following the rules listed in this section, an application can create valid names for files and directories regardless of the file system in use.
Backslashes (\) are used as element dividers in paths (dividing the file name from the path to it, or directories from one another in a path). You cannot use them in file or directory names. They may be required as part of volume names (for example, "C:\").
-- ---------------------------------------------------------- http://www.uscricket.com "Yakimo" <tyakimov@nospams.no> wrote in message news:eA5iwpCtEHA.624@TK2MSFTNGP09.phx.gbl... > Doesn't work, Jim. Here is the output: > ---------------------------------- > C:\Temp\Content\t>del \\.\c:\temp\content\t\*.* > \\.\c:\temp\content\t\*.*, Are you sure (Y/N)? y > \\.\c:\temp\content\t\?.p? > The filename, directory name, or volume label syntax is incorrect. > \\.\c:\temp\content\t\F vk.< > The filename, directory name, or volume label syntax is incorrect. > \\.\c:\temp\content\t\=~->ºF-? > The filename, directory name, or volume label syntax is incorrect. > -------------------------------- > > I also tried > rd \\.\c:\temp\content\t /s > The result is exactly the same as above: the same error message > > I am hoping there are other ideas :-) > > ./Yakimo > > > "Jim Byrd" <jrbyrd@spamlessadelphia.net> wrote in message > news:O6yFhCAtEHA.3200@TK2MSFTNGP14.phx.gbl... >> Hi Yakimo - Courtesy of Dave Patrick: Try prepending the path w/ \\.\ >> >> Ex: >> >> del \\.\Drive:\directory\*.* >> (Note: the period between \\ and \) >> >> This syntax bypasses the reserved word check allowing you to delete. >> >> -- >> Please respond in the same thread. >> Regards, Jim Byrd, MS-MVP >> >> >> >> In news:%23mNEP47sEHA.636@TK2MSFTNGP09.phx.gbl, >> Yakimo <tyakimov@nospams.no> typed: >> > Bill, >> > that is one of the first things I tried. I got: >> > C:\Temp\Content\t\=~->ºF-? >> > The filename, directory name, or volume label syntax is incorrect. >> > >> > Any other suggestions? >> > >> > "Bill James" <wgjames@mvps.org> wrote in message >> > news:%23hU7sq7sEHA.1276@TK2MSFTNGP12.phx.gbl... >> > If there is nothing in that directory that you need to save, try >> > changing to that directory (important), then executing the command >> > del *.* to see if that will remove the files. If there are files >> > you need to keep, move them to another folder first, since using the >> > wildcard * will cause your good files to also be deleted if they are >> > in the same folder. >> > >> > >> > "Yakimo" <tyakimov@nospams.no> wrote in message >> > news:u8aiUj6sEHA.1216@TK2MSFTNGP10.phx.gbl... >> >> Yes, it shows exactly the same file names, with those wrong >> >> characters. Here is the output of DIR /X >> >> 10/16/2004 07:48 PM <DIR> .. >> >> 03/13/2003 10:57 AM 0 .p >> >> 10/16/2004 07:48 PM 0 1.txt >> >> 03/13/2003 10:57 AM 16,384 èÿÿÿvk.< >> >> 07/24/2105 01:00 AM 805,109,760 ð~Ð>§è >> >> >> >> "Lanwench [MVP - Exchange]" >> >> <lanwench@heybuddy.donotsendme.unsolicitedmail.atyahoo.com> wrote in >> >> message news:ucqnXe5sEHA.2668@TK2MSFTNGP12.phx.gbl... >> >>> Yakimo wrote: >> >>>> I run WindowsXP. >> >>>> There are 3 files, created somehow, that I cannot delete. >> >>>> I read all the posts from the group but I couldn't find my case. >> >>>> Nothing is working - moving files, RD, del /s .... from DOS >> >>>> The problem is that filenames used weird characters. >> >>>> Filenames look like: >> >>>> ?~?>º?? >> >>>> .p >> >>>> ? vk.< >> >>>> >> >>>> if I go CMD and try to do whatever, I get "The filename, directory >> >>>> name, or volume label syntax is incorrect." >> >>> >> >>> If you type in dir /x in a command prompt in this folder, does it >> >>> show you the file names? >> >>> >> >>> >> >>>> I tried chkdsk /f and it didn't help >> >>>> CheckDisk from drive properties, tools doesn't help either >> >>> >> >>> It's the same thing as chkdsk. >> >>> >> >>>> >> >>>> Any good ideas? >> >>>> >> >>>> Thanks, >> >>>> Yakimo >> > >
- Next message: Terry Pinnell: "Performance Monitor - odd behaviour"
- Previous message: Drew Tognola: "Re: downloading updates"
- In reply to: Yakimo: "Re: cannot delete file: cannot read from the source file or disk"
- Next in thread: Jim Byrd: "Re: cannot delete file: cannot read from the source file or disk"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|