Discussion:
File Upload/Download on MacOSX
Andrius Rinkevicius
2014-05-16 09:00:54 UTC
Permalink
Olivier,
I am working at the moment for making File Upload/Download available on
MacOSX (by the way, would it be more correct to call Sync Directories or
like that?), and I need advice.
Mounting of ftp/sftp shares is not possible on OSX (gvfs/dbus are not
ported). So, we need to use other software for mounting, and the only open
source and free option available is MacFUSE/Macfusion. It works reasonably
well, however, it seems that it is essentially single threaded application.
While Upload/Download code uses multiple threads. As result, when
uploading/downloading I am getting multiple errors of "Failed copy file"
with "Permission denied". Especially when downloading from remote directory.
I already tried following:
1. Reduced number of workers in queues to 1. This improved situation.
Instead of tens of errors I was getting just few. Flat directories (without
sub-directories) was copied mostly without errors. However, if there was
deeper directory structure, there was still a lot of errors.
2. Replaced g_file_copy_async() with synchronous version. This probably
improved situation a little bit, but still there is number of errors. If
errors are produced I can push Download button several times, each time the
number of errors is smaller until finally there is zero errors and
directories are synced. The number of pushes needed correlates to the depth
of directory tree.
It looks that recursive calls to walk_local_directory() in
walk_local_directory_job() might be an issue. I am thinking how to solve
this issue. Maybe, instead of calling walk_local_directory() recursively we
can add uri to list, and walk it in idle callback?
Any suggestions are welcome.
Andrius
Olivier Sessink
2014-05-16 12:36:58 UTC
Permalink
Post by Andrius Rinkevicius
Olivier,
I am working at the moment for making File Upload/Download available
on MacOSX (by the way, would it be more correct to call Sync
Directories or like that?), and I need advice.
Mounting of ftp/sftp shares is not possible on OSX (gvfs/dbus are not
ported). So, we need to use other software for mounting, and the only
open source and free option available is MacFUSE/Macfusion. It works
reasonably well, however, it seems that it is essentially single
threaded application. While Upload/Download code uses multiple
threads. As result, when uploading/downloading I am getting multiple
errors of "Failed copy file" with "Permission denied". Especially when
downloading from remote directory.
1. Reduced number of workers in queues to 1. This improved situation.
Instead of tens of errors I was getting just few. Flat directories
(without sub-directories) was copied mostly without errors. However,
if there was deeper directory structure, there was still a lot of errors.
2. Replaced g_file_copy_async() with synchronous version. This
probably improved situation a little bit, but still there is number of
errors. If errors are produced I can push Download button several
times, each time the number of errors is smaller until finally there
is zero errors and directories are synced. The number of pushes needed
correlates to the depth of directory tree.
It looks that recursive calls to walk_local_directory() in
walk_local_directory_job() might be an issue. I am thinking how to
solve this issue. Maybe, instead of calling walk_local_directory()
recursively we can add uri to list, and walk it in idle callback?
Any suggestions are welcome.
Andrius
would it be an option to create some kind of gvfs wrapper on OSX?

so when an async function is called we check if it is on a remote URL,
and use a synchronous wrapper backend?

(btw how difficult would it be to port GVFS instead of writing our own
wrappers for macfuse?)

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius Rinkevicius
2014-05-16 17:58:44 UTC
Permalink
Olivier,
Post by Olivier Sessink
would it be an option to create some kind of gvfs wrapper on OSX?
so when an async function is called we check if it is on a remote URL,
and use a synchronous wrapper backend?
I do not think it is an option. gvfs also requires dbus running, so one
would need to port/wrap dbus, and add to bluefish code to launch and
configure it.
Post by Olivier Sessink
(btw how difficult would it be to port GVFS instead of writing our own
wrappers for macfuse?)
I do not know, but I guess that is difficult. I asked similar question on
gtk-osx mailing list, but none replied. Actually I managed to compile some
older versions of dbus and gvfs on Mac without errors but I do not think
that it will be working on Mac.
Post by Olivier Sessink
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe bluefish-dev" in
panel at http://www.ems.ru/cgi-bin/listargate.cgi
Bluefish web site: http://bluefish.openoffice.nl/
Jim Hayward
2014-05-17 03:01:57 UTC
Permalink
Post by Andrius Rinkevicius
Olivier,
I am working at the moment for making File Upload/Download available
on MacOSX (by the way, would it be more correct to call Sync
Directories or like that?), and I need advice.
Mounting of ftp/sftp shares is not possible on OSX (gvfs/dbus are not
ported). So, we need to use other software for mounting, and the only
open source and free option available is MacFUSE/Macfusion.
Mounting remote shares isn't necessary to simply upload/download files.
A potential option would be to use libcurl to upload/download remote
files. It's been around forever and open source licensed. Another
potential benefit might be that libcurl also does support Windows.

The downside is probably that it would require it's own new GUI.
Although the GUI could be designed to improve this feature on Linux too.
Albeit using GVFS on Linux.


Regards,
Jim H
Andrius Rinkevicius
2014-05-17 06:07:31 UTC
Permalink
Post by Jim Hayward
Mounting remote shares isn't necessary to simply upload/download files.
A potential option would be to use libcurl to upload/download remote
files. It's been around forever and open source licensed. Another
potential benefit might be that libcurl also does support Windows.
The downside is probably that it would require it's own new GUI.
Although the GUI could be designed to improve this feature on Linux too.
Albeit using GVFS on Linux.
I agree that curl is an option (Apple even includes library into OSX). But
as You mentioned, complete rewrite of GUI will be required. In addition, it
is not completely clear for me if this will support smb shares. I think it
would be easier for MacOSX to modify current code since right now not that
much is missing.
Andrius

Loading...