PC Review


Reply
Thread Tools Rate Thread

FSO permission denied copy file

 
 
eric
Guest
Posts: n/a
 
      6th Nov 2003
Don't be fooled by the subject, this is not your typical
security permissions problem.

Scenario, client applications generate a text file that is
copied to a network share on Win2k server. A VB6 app
using a timer control monitors this directory every one
second looking for files. When it finds files, the first
thing it does is copied the file to another directory for
backup purposes. This is where the error is, permission
denied when using the Scripting.FileSystemObject.File.Copy
method. Security permissions are fine, don't need to go
there.

Once the app crashes, then is restarted it processes the
same file it errored out on w/o any problem.

It seems that something still has a lock on the file when
the app tries to copy the file to the backup folder.

Does anyone have any idea why a lock would/could stay on a
text file for a prolonged period of time?

Thanks in advance.
 
Reply With Quote
 
 
 
 
DanielW
Guest
Posts: n/a
 
      7th Nov 2003
OK, I think I have a solution for your problem.
You say you check for existing files every 1 second. I say
reduce this down to every 3 - 4 seconds. You are probably
trying to access it as it is bing created. I would turn
on error catching and just loop the file move command
until the err.num value is 0.

Do you understand this? If not copy your snippet of code
that moves the file and I will modify it for you.

Daniel W
using your vb6 app.
>-----Original Message-----
>Don't be fooled by the subject, this is not your typical
>security permissions problem.
>
>Scenario, client applications generate a text file that

is
>copied to a network share on Win2k server. A VB6 app
>using a timer control monitors this directory every one
>second looking for files. When it finds files, the first
>thing it does is copied the file to another directory for
>backup purposes. This is where the error is, permission
>denied when using the

Scripting.FileSystemObject.File.Copy
>method. Security permissions are fine, don't need to go
>there.
>
>Once the app crashes, then is restarted it processes the
>same file it errored out on w/o any problem.
>
>It seems that something still has a lock on the file when
>the app tries to copy the file to the backup folder.
>
>Does anyone have any idea why a lock would/could stay on

a
>text file for a prolonged period of time?
>
>Thanks in advance.
>.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy XP User Profiles - Permission Denied John Windows XP Security 1 30th Jul 2007 05:19 PM
How give copy permission on a file without read permission Sam Windows Networking 1 19th Jan 2007 04:06 PM
Denied permission to copy table into another database =?Utf-8?B?anNjY29ycHM=?= Microsoft Access VBA Modules 0 7th Dec 2005 07:56 PM
msi file copy permission denied narshe@gmail.com Microsoft Dot NET Framework 0 8th Nov 2005 10:13 PM
.pst File permission denied Bill Microsoft Outlook Discussion 1 13th Aug 2004 01:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:51 AM.