Nick Vatamaniuc wrote:
> glenn wrote:
> > Hi
> > can anyone tell me how given a directory or file path, I can
> > pythonically tell if that item is on 'removable media', or sometype of
> > vfs, the label of the media (or volume) and perhaps any other details
> > about the media itself?
> > thanks
>
> As soon as you ask for "cross platform" and something that is
> device/OS specific... you have conflict.
>
> From the win32 extensions:
>
> win32file.GetDriveType
> int = GetDriveType()
>
> Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk,
> or network drive.
>
> R
Dennis is absolutely right. The reason you won't find a method in the
standard libraries for doing this task specifically is because python
aims to by cross-platform. If it were to support a method that worked
in the way you describe specifically for Windows, that would
essentially break python's
glenn wrote:
> Hi
> can anyone tell me how given a directory or file path, I can
> pythonically tell if that item is on 'removable media', or sometype of
> vfs, the label of the media (or volume) and perhaps any other details
> about the media itself?
> thanks
> Glenn
It won't be trivial because
glenn wrote:
> Hi Jay
> pls excuse top post - Im actually doing this project in linux, but am
> wanting it to be cross platform. I definitley have to cater for win32
> also. I was hoping that burried in sys or os or that there'd be some x
> platform module that did all that stuff for me
>
Thin
Hi Jay
pls excuse top post - Im actually doing this project in linux, but am
wanting it to be cross platform. I definitley have to cater for win32
also. I was hoping that burried in sys or os or that there'd be some x
platform module that did all that stuff for me
thnks for reply though
glenn
J
Well, in linux you can get a lot of info about where a file is based
upon where it lies in the file system. For example, if the folder the
file is located in resides in the /media or /mnt directories, then the
file is, barring a few rare circumstances, located upon a removable
medium of some sort.
Hi
can anyone tell me how given a directory or file path, I can
pythonically tell if that item is on 'removable media', or sometype of
vfs, the label of the media (or volume) and perhaps any other details
about the media itself?
thanks
Glenn
--
http://mail.python.org/mailman/listinfo/python-list