1

I've been reading through the FileSystem documentation in Python from here: http://packages.python.org/fs/filesystems.html

After taking the time to read through it and a bit of Google-ing I didn't quite find the answer I was looking for. I was wondering if it was possible with Python, and avoiding any UAC issues on Windows, if you could 'mount' or display a file free from an FTP server inside Windows Explorer for any other applications to -read- from.

Is something this possible? What's the best approach to achieve it? Thanks in advance!

juliomalegria
  • 24,229
  • 14
  • 73
  • 89
user1130601
  • 237
  • 1
  • 4
  • 15
  • 1
    Windows explorer has built-in support for FTP. – Paulo Scardine Feb 23 '12 at 21:45
  • Uhm well, on a good operating system for professionals like GNU/Linux, you could use `fuse`. I don't know about your situation, is this thing you're doing for gamers? If not, you may consider upgrading to Linux. – Flavius Feb 23 '12 at 21:46

3 Answers3

2

Windows explorer has built-in support for FTP, instructions with screenshots here.

  1. Open Windows Explorer (My computer)
  2. Right-click anywhere in the folder, and then click Add a Network Location.
  3. This displays the Add Network Connection wizard. Click Next.
  4. In the wizard, select Choose a custom network location, and then click Next.
  5. Enter the name of the FTP site, with the full FTP:// in front of it, and then click Next (something like - for example if you domain name is DOMAIN.NET the full name should look like this: ).
  6. To use a name and password, clear the Log on anonymously check box. Type your FTP Account Username, and then click Next.
  7. By default, the name of the shortcut is the same as the FTP address. If you want to give the shortcut a different name, type it in the Type a name for this network location box. Click Next.

You can even use it from the standard "file" dialog box. Is it enough?

[update]

Out of curiosity, does this have support for FTPS and/or SFTP? – André Caron

@AndréCaron: I think WebDAV with SSL is supported, but no native support for SFTP or FTPS. There are extensions like Swish (opensource) or Expandrive (payware).

Paulo Scardine
  • 73,447
  • 11
  • 124
  • 153
1

This is a non-trivial matter and afaik there exist not such a thing as provide os-level functionality through some lines of magical python code.

A possible solution to emulate your intention could be to create a local webdav proxy, which maps to the ftp-server. I know there exists a feature to attach a webdav-network device to a local drive-letter, but because the last time i touched a windows system was ... - i can't even remember - i can't tell you if you might also attach a ftp-resource this way directly.

I guess looking for a solution on a python level might not be productive in a short-term perspective and even on mid/long-term's not possible without heavy tinkering on your side.

Don Question
  • 11,227
  • 5
  • 36
  • 54
1

While not a "filesystem" per-se, you can provide a Windows Explorer Namespace Extension which will allow the Windows explorer to browse any virtual file-system. This is used to implement browsing of ZIP archives, for example. Note that this does not provide a real file system drive, so it will not allow you to open the contents of this namespace extension using regular file I/O functions.

The namespace extensions are written in COM, and it is possible to implement COM interfaces in Python.

AFAIK, the only permissions you need are for installing of the namespace extension (the COM DLL, plus the namespace registration). Everything else runs in the logged-in user's context and requires no special permissions.

André Caron
  • 44,541
  • 12
  • 67
  • 125