My original named pipe test was on OSX, but I did an strace, on my linux
workstation, on the Maya process to see what is happening when it saves the
scene. This seems to explain the behaviour:

```
# Scene saved to:  /tmp/test.ma
stat("/tmp", ...)
...
lstat("tempUIFilezofrPP", ...)
access("/tmp/justin/tempUIFilezofrPP", ...)
open("/tmp/justin/tempUIFilezofrPP", O_WRONLY|O_CREAT|O_TRUNC, 0666)
stat("/tmp/justin/tempUIFilezofrPP", ...)
chmod("/tmp/justin/tempUIFilezofrPP", 0664)
open("/tmp/justin/tempUIFilezofrPP", O_RDONLY)
unlink("/tmp/justin/tempUIFilezofrPP")
...
access("/tmp/test.ma", F_OK)
access("/tmp/test.ma", W_OK)
access("/tmp/test.ma", F_OK)
lstat("/tmp/test.ma.matu7GqL", ...)

*rename("/tmp/test.ma <http://test.ma>", "/tmp/test.ma.matu7GqL")*
open("/tmp/test.ma", O_WRONLY|O_CREAT|O_TRUNC, 0666)
stat("/tmp/test.ma.matu7GqL", ...)
chmod("/tmp/test.ma", 0664)
unlink("/tmp/test.ma.matu7GqL")
```

So what Maya does is it moves the given path to a temp name if it already
exists, then writes the new scene to your given path, and if all succeeds,
it removes the previously existing one. I don't know what it is doing with
that first temp file that it uses. Not sure what gets written there, but
the location is based on your tmp location. The rename all happens in the
same location of the specified filepath. So while it won't work for
solutions where you expect the file to be created ahead of time and
directly written to, this does seem to work... On my linux box, by default,
I have "/dev/shm" which is the shared memory tmpfs device. I can save a
file to "/dev/shm/test.ma", and all of that takes place on the tmpfs
device, as opposed to needing to work with a single file. Although this
isn't really a portable solution.

All this academic stuff aside, are you pretty confident that your
bottleneck is disk IO on the scene file? I always thought Maya spent more
time on its actual export/import logic than the time it really takes to
read/write a sizeable scene file.


On Mon, Mar 16, 2015 at 1:24 AM Marcus Ottosson <[email protected]>
wrote:

> Also, I did a quick test using a named pipe, but it doesn’t work since I
> think Maya writes out its file to a temp area and the moves it into place,
> as opposed to opening the filepath you give it and writing to it
>
> I had a go with this, just monitoring which files were being accessed
> during saving a big file, and on my end it does look like it is directly
> writing to the given path.
>
> Are you able to figure out where your temporary area was? Could it have
> been a Linux-thing, or perhaps something to do with the way you were
> writing it?
> ​
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/CAFRtmOCO2BWdSu7S12y1%3DLRgzZ-
> DGWTBpfMO0i4SGXNG7dzv2A%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCO2BWdSu7S12y1%3DLRgzZ-DGWTBpfMO0i4SGXNG7dzv2A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA05eyYTg4FcQduAHWJLO8L%3DfrDkBsm3%2BvwznyJii2_bYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to