flaxsearch / flaxcode

Automatically exported from code.google.com/p/flaxcode
4 stars 1 forks source link

Can't index mapped drives or server file paths on Windows #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On a Windows system a drive letter mapped to another path cannot be
indexed. Indexing causes the error:

2007-12-20 13:43:00,559: indexing.remote: 1580: ERROR: File path h:\ is
neither a directory or a file:

We're using os.path.isdir() and isfile() - I'm wondering if on Windows a
mapped drive is some kind of symlink...

Original issue reported on code.google.com by charliej...@gmail.com on 20 Dec 2007 at 1:56

GoogleCodeExporter commented 9 years ago
Also mapped server paths like \\servername\folder\folder2 don't work: error is:

File path \\userfs\stafffs\sccv1\w2k is neither a directory or a file:

Original comment by charliej...@gmail.com on 20 Dec 2007 at 1:57

GoogleCodeExporter commented 9 years ago
Bookmarking for later: a C program showing how to find the actual location of a
Windows share:
http://msdn2.microsoft.com/en-us/library/aa385334(VS.85).aspx

It seems the root problem is that os.isdir() returns FALSE for a Windows share, 
so
the current code in filespec.py bombs.

Original comment by charliej...@gmail.com on 21 Dec 2007 at 11:46

GoogleCodeExporter commented 9 years ago
http://mail.python.org/pipermail/python-announce-list/1999-July/000106.html

RB suggest we could do os.path.isdir(foo) or os.path.isdir(foo + '\\') (but 
only on
Windows as on Linux you can conceivably have '\' as part of the filename).

Original comment by charliej...@gmail.com on 21 Dec 2007 at 12:07

GoogleCodeExporter commented 9 years ago
Actually, you could just do:

os.path.isdir(foo) or os.path.isdir(foo + os.path.sep)

which will be the equivalent to the previous suggestion, and work correctly on
unixoids too.

Original comment by boulton.rj@gmail.com on 9 Jan 2008 at 10:38

GoogleCodeExporter commented 9 years ago
The last suggestion works, but *only with the command line version of flax* - I 
think
this is a permissions problem, as the command line version will run as the local
user, whereas the Service won't.

Original comment by charliej...@gmail.com on 9 Jan 2008 at 11:17

GoogleCodeExporter commented 9 years ago
Setting up the Service to act not as the Local System account, but to use an 
account
that has access to the network share, fixes this problem. I'll add a FAQ entry 
on this.

Original comment by charliej...@gmail.com on 9 Jan 2008 at 11:21

GoogleCodeExporter commented 9 years ago
I assume you need to apply the os.path.isdir(foo) or os.path.isdir(foo + 
os.path.sep)
change as well, or it won't recurse into the drive even if it has permission?

Original comment by boulton.rj@gmail.com on 9 Jan 2008 at 11:22

GoogleCodeExporter commented 9 years ago
Yes, I've committed that. 

Original comment by charliej...@gmail.com on 9 Jan 2008 at 11:31