Hi Darrell,<br><br>This message definitely also belongs on the <a href="mailto:darcs-users@darcs.net">darcs-users@darcs.net</a> mailing list.  You can find information about how to subscribe here:<br><a href="http://lists.osuosl.org/mailman/listinfo/darcs-users">http://lists.osuosl.org/mailman/listinfo/darcs-users</a><br>
<br>Please join our list!  I&#39;m adding the list to the CC list in my reply.<br><br><div class="gmail_quote">On Fri, Sep 11, 2009 at 9:20 AM, Lewis-Sandy, Darrell <span dir="ltr">&lt;<a href="mailto:darrelll@amgen.com">darrelll@amgen.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks to everyone who pointed me in the right direction on this problem, I have been able to find a work around that allows me to push to an archive on a network file share.<br>

<br>
After some digging, I discovered the root of the problem.  Briefly,  Darcs uses the standard library System.Directory to perform file manipulations.  This library make use of compiler pragmas to conditionally compile either the Windows or Linux specific functions based on the host operating system.<br>

<br>
This approach assumes that when your operating system is a Linux variant, all your mounted volumes will natively support POSIX.  When you have mounted CIFS volumes, this will result in errors when calling those library functions to create, rename, copy and delete files or folders!   Given the flexibility of the Linux operating system, A more versatile implementation for System.Directory might be able to detect the file system of each volume at runtime and choose the appropriate functions to call.  But I digress...<br>

<br>
To workaround the inability to push to a CIFS volume in darcs, I modified the workaround.hs module to shell out to the OS&#39;s rename function rather than using the Haskell library&#39;s rename function.  Specifically:<br>
</blockquote><div><br>Ah clever way to test this.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I added the following code after the #else near line 80:<br>
<br>
renameFile :: FilePath -&gt; FilePath -&gt; IO ()<br>
renameFile old new = do<br>
     ecode &lt;- System.Cmd.rawSystem &quot;mv&quot; [old,new]<br>
     case ecode of<br>
         ExitSuccess -&gt; return ()<br>
         ExitFailure n -&gt; putStrLn (&quot;renameFile failed with exit code&quot; ++ show n)<br>
<br>
which ensures that when the operating system is not WIN32, that renaming of files will be performed by the OS shell.  I then added the System.Cmd module to the list of imports by inserting the following code near line 21<br>

<br>
import qualified System.Cmd(rawSystem)<br>
<br>
after a recompile I could push to a CIFS volume, for example:<br>
<br>
sudo darcs push /mnt/cifsvol<br>
<br>
this is an obvious hack, and does not address the inability to put to a CIFS share (put depends upon copyFile and would need to be hacked to shell-out as well).   Archives on the CIFS share have to be created by navigating to that folder and initializing.<br>
</blockquote><div><br>Interesting.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Shelling out is clearly a poor long term solution; a longer term solution would ideally introduce into the Haskell System.Directory library the ability to apply the correct functions transparently in accordance with the file system of the volume.<br>
</blockquote><div><br>Yes, and in the meantime we can implement something like this in workaround.hs.<br><br>Thanks!<br>Jason<br></div></div>