Re: RmDir command generates an error 75 - Path/File access error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Carl Imthurn" <nospam@xxxxxxxxxx> wrote in message
news:eUU16CKwGHA.2204@xxxxxxxxxxxxxxxxxxxxxxx
There are two functions in the application I'm working on where we use the
RmDir command.

This one works exactly as advertised, and has never given us any problems:

'Check to see if this directory exists.
If Dir(cScanning.ScanHoldingDirectory & modUtilities.Username,
vbDirectory) <> "" Then ' this directory exists.
On Error Resume Next
' FYI - cScanning.ScanHoldingDirectory =
"\\MyServer\MyHiddenShare$\"
' modUtilities.Username = "cimthurn"
Kill (cScanning.ScanHoldingDirectory & modUtilities.Username &
"\scan.jpg") ' this file will always exist.
RmDir (cScanning.ScanHoldingDirectory & modUtilities.Username)
End If

This one *always* generates an error 75 - Path/File access error:
LINE NUMBERS ADDED FOR EXPLANATORY PURPOSES ONLY -- NOT IN CODE.

1 'First delete the old jpeg file.
2 On Error Resume Next
' FYI - cScanning.ScanDestinationDirectory =
"\\MyServer\FolderLevel1$\1234567\"
3 Kill (cScanning.ScanDestinationDirectory & OldScanNameIn) ' this file
will always exist
4 On Error GoTo ErrorHandler
5 'Next, check to see if the folder is empty, and if it is, delete it.
6 If Dir(cScanning.ScanDestinationDirectory & "*.*") = "" Then 'the
directory is empty. Delete it.
7 On Error Resume Next
8 Kill cScanning.ScanDestinationDirectory & "*.*"
9 Dir ("c:\")
' ERROR 75 ON THE FOLLOWING LINE
10 RmDir (Left(cScanning.ScanDestinationDirectory,
Len(cScanning.ScanDestinationDirectory) - 1))
End If

Here's everything we've tried so far:
1) Insertion and removal of line 9
2) Insertion and removal of line 8
3) Removal and insertion of trailing "\" in the Left() function in line 10
4) Insertion and removal of the & "*.*" in line 6
5) Change line 9 to Dir
6) Change line 9 to Call Dir$("nul")
7) Close the IDE and re-launch the project (twice)

At this point we're at a loss. Any help will be gratefully accepted.

Thanks --

Carl

One guess I could make is that Kill doesn't delete all files (and it doesn't
delete hidden, system and read-only files). So the simplest check you should
do is to check whether folder is actually empty before that line of code
(#10), making sure that there no hidden files as well. If this is the case
than you'll need to reset all attributes on files before using Kill method.

OT. Never use parentheses, when calling methods - either remove them or use
Call keyword. It might be not important here, but may bite you in other
cases.

Dmitriy.


.



Relevant Pages

  • Re: Bonnie++ Burps on XFS
    ... Anything in your system log? ... I had filesystem corruption and needed ran xfs_repair. ... rmdir: `658616481': Directory not empty ...
    (Linux-Kernel)
  • [RFC][PATCH 4/4] cgroup-memcg fix frequent EBUSY at rmdir
    ... When trying following test under memcg. ... You'll see -EBUSY at rmdir very often. ... or false error code if the cgroup has ...
    (Linux-Kernel)
  • Re: Removing corrupted directory
    ... I can toggle the bits with ... I'm not sure if rmdir behaves any differently than rm -r but have ... > The command rmdir is just a safety command, only removing empty ...
    (comp.sys.mac.system)
  • Re: file with no name -- cannot be deleted
    ... Then you can create a link to the inode: ... Then the directory should be empty and you can delete it? ... so I unmounted it and ran fsck and am ... rmdir: yyy/: Directory not empty ...
    (Ubuntu)