NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 10 11 12 13 14 … 93 Next »
Puzzling exception

 
  • 0 Vote(s) - 0 Average
Puzzling exception
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,591
Threads: 386
Joined: Dec 2004
#1
2012-03-07, 02:00 AM
Trying to solve a problem in the nDroid service when users have videos/music media on network shares I find I can't enumerate the directories when the path is the root of a mapped network drive.

Using this code where foldername is Z:\
Code:
List<string> folderList = null;
try
{
    folderList = new List<string>(Directory.GetDirectories(folderName, "*.*", SearchOption.TopDirectoryOnly));
}
catch (DirectoryNotFoundException dnfe)
{
    Log.LogException("GetMediaFolderContents() - enumerating folders", dnfe);
    return "";
}
...I catch a DirectoryNotFoundException logged as
Code:
GetMediaFolderContents() - enumerating folders threw exception: Could not find a part of the path 'Z:\'.   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
   at System.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption)
According to the MSDN page for Directory.GetDirectories that exception reason is "The specified path is invalid (for example, it is on an unmapped drive)." but the drive IS mapped and the nDroid service has permission to access it.

The weird thing is what I'd expect to fail is passing the sharename into that function (\\myserver\music\) but that actually DOES work. :confused:

This is only happening for mapped networked drives - D:\ for example (which is local), works fine.

Anybody seen anything like this? Got a cure?
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,130
Threads: 957
Joined: May 2006
#2
2012-03-07, 02:05 AM
Is this related to your other post where I wrote about "Local System" issue http://forums.nextpvr.com/showthread.php...post431289 ? You won't see mapped drive letters either.

Martin
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,591
Threads: 386
Joined: Dec 2004
#3
2012-03-07, 02:30 AM
mvallevand Wrote:Is this related to your other post where I wrote about "Local System" issue http://forums.nextpvr.com/showthread.php...post431289 ? You won't see mapped drive letters either.
Yes and no but I think you've just pointed me in the right direction.

No I'm not using LocalSystem to run the service, I'm using my usual account which currently has Z: mapped.

But of course the account details just provide login / user privileges and it doesn't mean it's sharing my current user process so the service process doesn't have a Z: mapped. Doh!

At least that explains it. Thanks.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  PlayAudioFile() throws exception bgowland 2 1,625 2008-10-09, 10:37 PM
Last Post: bgowland
  Error initializing event plugin: Exception has been thrown by the target of an invoca ralphy 1 2,075 2008-01-21, 11:23 PM
Last Post: ralphy
  Exception when querying gbpvr.db3 bgowland 5 2,130 2007-12-16, 07:47 PM
Last Post: bgowland
  Database locked exception bgowland 3 2,109 2007-10-20, 09:24 PM
Last Post: bgowland
  Unhandled exception handling in GB-PVR ubu 7 2,432 2007-02-18, 02:54 AM
Last Post: sub
  exception when calling scheduledRecording.getProgramme().getTitle() (manual rec) betlit 2 1,435 2005-09-23, 03:01 PM
Last Post: betlit
  hashtable Exception CodeMonkey 2 3,145 2004-04-11, 08:55 PM
Last Post: CodeMonkey

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode