Controlling the Deletion of a File
From: Struggling Rod (StrugglingRod_at_discussions.microsoft.com)
Date: 02/25/05
- Next message: Rick Rothstein: "Re: Question about replacing a character"
- Previous message: Wishing I was skiing mom: "Can not select Combo box in design mode"
- Next in thread: MikeD: "Re: Controlling the Deletion of a File"
- Reply: MikeD: "Re: Controlling the Deletion of a File"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 10:33:03 -0800
I am writing a generic subroutine in VB6 to delete a file. The subroutine
needs to check the file to make sure it's deletable. For example, the file
shouldn't be already open or locked. I plan to use the File System Object's
method "DeleteFile" to delete a file.
How do I check whether a file is already open or locked?
What file attributes indicate that a file is OK to delete? I suspect I would
want to limit the attributes only to Normal or ReadOnly. I know various
constants that attributes can be: 0 = Normal, 1 = ReadOnly, 2 = Hidden, etc.,
up to 64 = Alias. Are there any more values?
I believe there is also an attribute for a Compressed file--what is the
value of this attribute?
I have a certain file whose attribute value is 8192. What does this value
mean?
In general, I would like to know under what specific conditions I shouldn't
delete a file and how I test these conditions.
is there already such a subroutine written? If so, can someone direct me to
its code?
- Next message: Rick Rothstein: "Re: Question about replacing a character"
- Previous message: Wishing I was skiing mom: "Can not select Combo box in design mode"
- Next in thread: MikeD: "Re: Controlling the Deletion of a File"
- Reply: MikeD: "Re: Controlling the Deletion of a File"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|