Re: file delete routine is intermittent
- From: "Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx>
- Date: Tue, 19 Apr 2005 15:33:54 -0600
Mike,
> Try this:
>
> .pFrom = file2delete & vbNullChar & vbNullChar 'the file to delete
This is not necessary as Visual Basic automatically appends a single null
terminator character to every string.
I wondered about the double terminator at the end, that could be a problem.
However, if SHFileOperation didn't find a double terminator, it would
attempt to delete additional filenames and wouldn't skip filenames as the OP
complained about.
> pFrom
> Address of a buffer to specify one or more source file names. These names
> must be fully qualified paths. Standard DOS wild cards, such as "*", are
> permitted in the filename position. Although this member is declared as a
> null-terminated string, it is used as a buffer to hold multiple file
names.
> Each file name must be terminated by a single NULL character. An
additional
> NULL character must be appended to the end of the final name to indicate
the
> end of pFrom.
Sounds like his best bet is to simply pass the wildcard specification to
SHFileOperation instead of locating matching filenames himself. He may also
want to use my wrapper class as that deals with some other potential
problems.
--
Jonathan Wood
SoftCircuits
http://www.softcircuits.com
Available for consulting: http://www.softcircuits.com/jwood/resume.htm
.
- Follow-Ups:
- Re: file delete routine is intermittent
- From: MikeD
- Re: file delete routine is intermittent
- From: Jim Carlock
- Re: file delete routine is intermittent
- References:
- file delete routine is intermittent
- From: Steve Easton
- Re: file delete routine is intermittent
- From: MikeD
- file delete routine is intermittent
- Prev by Date: Re: WIN32 API SOURCE
- Next by Date: SetTextCharacterExtra and RTL langs: major bug?
- Previous by thread: Re: file delete routine is intermittent
- Next by thread: Re: file delete routine is intermittent
- Index(es):
Relevant Pages
|