On 6 Oct 2000, Jean-Marc Lasgouttes wrote:
> >>>>> "Dekel" == Dekel Tsur <[EMAIL PROTECTED]> writes:
>
> Dekel> What happens when you export as DVI? The export code performs
> Dekel> all work in the temp directory, and then moves the file to the
> Dekel> correct directory. I think that your problem is that your temp
> Dekel> directory is not on the same drive as the .lyx file directory,
> Dekel> and therefore the file cannot be moved. So, in this case we
> Dekel> should copy the file, instead of moving it. Is there a way to
> Dekel> check if two directories are on different drives?
>
> Yes, my files are on different filesystems (mfs and afs). I think the
> right solution is to define a lyx::move function which tries first to
> move the file and then, if it failed, copy/delete it.
>
> JMarc
>
If I may make a suggestion, /bin/mv can move files (but not directories)
accross filesystems. If we spawn it, we avoid the entire problem [this may
not work on a (future) native port to Win32/MacOS]. I think there was a
decision against this approach.
If we wish to do this ourselves, the st_dev field of the stat structure
(the one filled by stat & fstat) tells you which device (a.k.a filesystem)
the file is on. This is easy to add to support/FileInfo.[Ch]. Another
option is statfs (Linux) statvfs (Solaris, IRIX) which takes a filename
and reports the filesystem on which the file resides.
Lior.