Media Companion
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Media Companion

Discussion and development board for the program Media Companion.
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Bug for directory access

Go down 
3 posters
AuthorMessage
tiben20
New User
New User



Posts : 5
Join date : 2008-10-18
Age : 28

Bug for directory access Empty
PostSubject: Bug for directory access   Bug for directory access Icon_minitimeFri Nov 28, 2008 7:38 am

This is a bug that i have since the first version of media companion
The application wont scan the directory because the folder contain an Unauthorized directory.
System.UnauthorizedAccessException: Access to directory 'V:\RECYCLER\S-1-5-21-602162358-308236825-725345543-1003' is refused
I have no idea how you did your function for getting the folders in a directory
but i did a little function that work without any errors
Code:

Function getdirectory(ByVal path As String) As List(Of String)
        On Error Resume Next
        Dim dirtoreturn As New List(Of String)
        For Each dirtoadd As String In System.IO.Directory.GetDirectories(path)
            dirtoreturn.Add(dirtoadd)
        Next
        Return dirtoreturn
    End Function
this way if the directory cant be accessed its only going to skip the directory
if you have any question about that just ask
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

Bug for directory access Empty
PostSubject: Re: Bug for directory access   Bug for directory access Icon_minitimeSun Nov 30, 2008 12:07 pm

I'd rather avoid the exception altogether. I had a similar problem with the Sytem Restore Folder many versions ago.

I'll filter out the RECYCLER folder from the next version.

Are there any other system folders that you can think of that would cause an exception?
Back to top Go down
http://billyad2000.co.uk
tiben20
New User
New User



Posts : 5
Join date : 2008-10-18
Age : 28

Bug for directory access Empty
PostSubject: Re: Bug for directory access   Bug for directory access Icon_minitimeMon Dec 01, 2008 7:58 am

hummmmmm
i took a look into the object browser in vb2008 and you actually got in System.IO
in the DirectoryInfo you got
Code:

Public Function GetAccessControl() As System.Security.AccessControl.DirectorySecurity
    Member of System.IO.DirectoryInfo
Summary:
Gets a System.Security.AccessControl.DirectorySecurity object that encapsulates the access control list (ACL) entries for the directory described by the current System.IO.DirectoryInfo object.

Return Values:
A System.Security.AccessControl.DirectorySecurity object that encapsulates the access control rules for the directory.

Exceptions:
System.SystemException: The directory could not be found or modified.
System.UnauthorizedAccessException: The current process does not have access to open the directory.
System.IO.IOException: An I/O error occurred while opening the directory.
System.PlatformNotSupportedException: The current operating system is not Microsoft Windows 2000 or later.
System.UnauthorizedAccessException: The directory is read-only.  -or- This operation is not supported on the current platform.  -or- The caller does not have the required permission.
Back to top Go down
wodi666
Junior Member
Junior Member



Posts : 17
Join date : 2008-10-15

Bug for directory access Empty
PostSubject: Re: Bug for directory access   Bug for directory access Icon_minitimeSun Dec 21, 2008 2:45 am

Quote :
Are there any other system folders that you can think of that would cause an exception?

For example "comodo internet security" don't allow to scan their virus vault. IMHO it's not a resolve to filter out special folder, you have to catch that kind of exception and solve the problem.

wodi666
Back to top Go down
Sponsored content





Bug for directory access Empty
PostSubject: Re: Bug for directory access   Bug for directory access Icon_minitime

Back to top Go down
 
Bug for directory access
Back to top 
Page 1 of 1
 Similar topics
-
» config.xml access denied
» V1.997 delete tvshow directory, scraping for others stops
» DVDs in TV shows directory possible?
» v3.237 Ampersand ('&') in tv show directory name sometimes fails
» Need help with Movie directory sorting and duplicates

Permissions in this forum:You cannot reply to topics in this forum
Media Companion :: Media Companion :: Bug Discussion-
Jump to: