1

Topic: CreateDir created "the not killed" directory

It was required to create subdirectory in the existing directory. Wrote the code:

var sDir: String;
sDir: = ' C:\Temp\Document1 ';//on the end a gap!
if sDir [Length (sDir)] <> ' \' then sDir: = sDir + ' \';
CreateDir (sDir);

The subdirectory has been created, but it appeared that it cannot be deleted. At attempt of removal of a folder with all contents Windows Explorer produces the message "it is not possible to delete a file. It is not possible to produce reading from a file or from a disk." The folder managed to be deleted by means of one of file managers (completely to delete instead of to send in "Basket").
Put in a gap on the end of a name of subdirectory. I can remove, of course, all gaps in the end of folder name before its creation, but it would be desirable to understand, why there is such problem.

2

Re: CreateDir created "the not killed" directory

crossa;
You try to deceive system, and she tries to deceive you smile
Most likely at creation of this directory "gap" is treated as any  the character (ax, 0920h) or tabulation.

3

Re: CreateDir created "the not killed" directory

crossa wrote:

it would be desirable to understand, why there is such problem.

Obviously, a bug in Windows Explorer.

4

Re: CreateDir created "the not killed" directory

For an example create pens a folder with a gap on the end smile
At you it does not turn out)))

5

Re: CreateDir created "the not killed" directory

;
Young  true decided to comprehend probably probably. smile here and to boringly it.

6

Re: CreateDir created "the not killed" directory

cmd.exe-> md "\\? \c:\123"
And then delete in an explorer))

7

Re: CreateDir created "the not killed" directory

crossa;
if you began)) create a folder "con"?

8

Re: CreateDir created "the not killed" directory

Barmaley57;
Not a mouse))

9

Re: CreateDir created "the not killed" directory

Well so windows explorer till now is not able to work with long names of files. Well it or is bad - at all I do not know)

10

Re: CreateDir created "the not killed" directory

Barmaley57;
More likely it is good) from  rescues. Otherwise a trouble, a trouble))

11

Re: CreateDir created "the not killed" directory

crossa wrote:

It was required to create subdirectory in the existing directory. Wrote the code:

var sDir: String;
sDir: = ' C:\Temp\Document1 ';//on the end a gap!
if sDir [Length (sDir)] <> ' \' then sDir: = sDir + ' \';
CreateDir (sDir);

The subdirectory has been created, but it appeared that it cannot be deleted. At attempt of removal of a folder with all contents Windows Explorer produces the message "it is not possible to delete a file. It is not possible to produce reading from a file or from a disk." The folder managed to be deleted by means of one of file managers (completely to delete instead of to send in "Basket").
Put in a gap on the end of a name of subdirectory. I can remove, of course, all gaps in the end of folder name before its creation, but it would be desirable to understand, why there is such problem.

Well so as there???
sDir: = ' C:\Temp\con
You will master?

12

Re: CreateDir created "the not killed" directory

Whence it is so much bile? I asked a specific question on a specific problem.
The folder with a gap on the end is created not by me personally: in my software solution users can set directory name, here and there was one user who casually entered directory name with a gap on the end. I never heard about this problem earlier; decided that it is any error in operation CreateDir. Now understood that it is an operating system problem.

13

Re: CreateDir created "the not killed" directory

Dimitry Sibiryakov wrote:

it is passed...
Obviously, a bug in Windows Explorer.

and it is even in the latest 10-ke