[Haskell-cafe] Re: Darcs and NFS Resolution
Trent W. Buck
trentbuck at gmail.com
Sat Sep 12 11:22:54 EDT 2009
[Due to circumstances beyond my control, I cannot CC the OP. Sorry.]
Jason Dagit <dagit at codersbase.com> writes:
>> [Darcs] assumes that when your OS is [POSIX], all your mounted
>> volumes will natively support POSIX.
Some CIFS servers (namely, Samba) *do* implement POSIX semantics. I
take it to OP is using a Microsoft CIFS server?
Is this the same problem as http://wiki.darcs.net/sshfs ?
>> renameFile :: FilePath -> FilePath -> IO ()
>> renameFile old new = -- [...]
>> System.Cmd.rawSystem "mv" [old,new]
>> -- [...]
>>
>> which ensures that when the operating system is not WIN32, that
>> renaming of files will be performed by the OS shell.
Ew. I'm not keen on calling mv(1) to handle each rename, let alone via
sh (which WILL explode on some paths, and allow injection attacks).
I'm also puzzled as to why this works -- surely mv(1) assumes POSIX
semantics, too? I would be interested in seeing the exact error
transcript, preferably as an issue on bugs.d.n. I'm not sure the
problem has been diagnosed correctly.
>> 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.
I guess someone should file a bug with them (in GHC's trac?).
> Yes, and in the meantime we can implement something like this in
> workaround.hs.
I definitely think this SHOULD NOT be enabled by default, unless you're
going to ONLY enable it in the specific scenario of CIFS on Linux.
More information about the Haskell-Cafe
mailing list