The program in the message you are replying to contains calls to many
Sage objects and functions, so you will need Sage to run the program.
Jason
William Stein added ffmpeg to sagenb, so that isn't a problem now, but
there is a permissions issue with writing to the DATA directory. So
the code still won't work as is on sagenb. I haven't figured out what
a permissible directory is to dump the frames into, maybe someone else
can comment on that.
Python has several calls to make temporary files that will not be
clobbered by other users or uses. No need to make directories.
Justin
--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
--
Democracy is two wolves and a lamb
voting on what to have for lunch.
Liberty is a well-armed lamb contesting
the vote.
Just to add to this (or subtract, I'm not sure). Sage doesn't use the
Python infrastructure for creating temporary directories (say under
/tmp), since Sage or its subprocesses tend to get brutally kill -9'd a
lot, etc., and if we used some standard tmp system without care, sage
would end up leaving a lot of crap around. Right now, whenever a Sage
process creates temp directories, it uses the function tmp_dir()
which creates the temp directory in
$DOT_SAGE/temp/hostname/pid/
The Sage cleaner, which is a totally different python process from any
particular Sage you run, will look for processes that have died but
left around temp files, and it will delete them all (it also kills all
subprocesses that were left around). It's finally very good at this,
though it used to not be.
-- William
>
>
>
> On Jan 15, 7:31 pm, "Justin C. Walker" <jus...@mac.com> wrote:
>> On Jan 15, 2009, at 19:02 , mabshoff wrote:
>
> <SNIP>
>
>>> Just use /tmp or DOT_SAGE/tmp, but create a directory in it so you
>>> don't clobber other jobs of the same kind. It might be a good idea
>>> to
>>> add some create_tmpdir() command in Sage that is guaranteed to be
>>> unique and is in a writable directory, i.e. it should first try
>>> DOT_SAGE/tmp, then /tmp and so on. IIRC there is even some env
>>> variable where we can point a per user tmp dir to. So you might want
>>> to open a ticket for the above in order to avoid various people
>>> doing
>>> the same thing in their own code over and over again.
>>
>> Python has several calls to make temporary files that will not be
>> clobbered by other users or uses. No need to make directories.
>
> Yes, but we are ending up calling command line tools which to not obey
> Python's convention :)
>
> And having all the files in one directory makes debugging a lot easier
> and it assures that you get rid of all files by just wiping the one
> tmp directory.
I think that the calls to create temp files put all files in the same
directory. But perhaps that isn't quite what you meant :-}
Justin
--
Justin C. Walker, Curmudgeon at Large
Director
Institute for the Enhancement of the Director's Income
-----------
Nobody knows the trouble I've been
-----------
If the temp files are truly temp files (i.e., not of interest when the
process that creates them exits), then there are Python calls that
help: the temp files can be created and unlinked, so that at exit,
they vanish. In fact, they are not visible in the file system at all.
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds
--------
If you're not confused,
You're not paying attention
--------
>
>
>
> On Jan 15, 10:52 pm, "Justin C. Walker" <jus...@mac.com> wrote:
>> On Jan 15, 2009, at 19:52 , William Stein wrote:
>
> <SNIP>
>
> Hi,
>
>> If the temp files are truly temp files (i.e., not of interest when
>> the
>> process that creates them exits), then there are Python calls that
>> help: the temp files can be created and unlinked, so that at exit,
>> they vanish. In fact, they are not visible in the file system at
>> all.
>
> Do you mean this?
>
> "os.tmpfile()
> Return a new file object opened in update mode (w+b). The file has no
> directory entries associated with it and will be automatically deleted
> once there are no file descriptors for the file. Availability: Unix,
> Windows"
>
> I don't see how this will work when I run "kill -9 $SOME_PID"
It works because there are no directory entries for it. It is just
held open by a file descriptor in the kernel. When the process exits,
the link count goes to zero (virtually), and the file structure [which
is on-disk, but not represented in any directory on-disk] is deleted.
Pas problem.
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
Experience is what you get
when you don't get what you want.
--------
Yup. If you need the files outside the creating process, you do need
to use a different call. But there is a tempfile procedure in Python
that does just what is needed (creates a visible-in-the-filesystem
file with a unique name).
Yeah; those old Unix guys (Ken and Dennis) thought of everything :-}
Justin
--
Justin C. Walker, Curmudgeon at Large
Director
Institute for the Enhancement of the Director's income
-----------
--
They said it couldn't be done, but sometimes,
it doesn't work out that way.
- Casey Stengel
--