[TxMt] Re: Storing variables on a window by window basis

Sean Dunn sd9 at sanger.ac.uk
Fri Feb 25 10:42:02 UTC 2011


Thanks Steve and Mitchell,

I'd sort of resigned my self to persisting to a file but I think that xattr
will do exactly what I want.

Cheers,
Sean.



Steve King-8 wrote:
> 
> On 2011-02-24 11:03, Sean Dunn wrote:
>> I'm trying to store information from the output a bundle command
>> against the current file.  The idea is that this could then be
>> retrieved by another bundle command run latter.
>>
>> This information doesn't need to be persistently stored, it's only
>> used during editing so if I can I'd prefer not to litter the file
>> system with these small files.
>>
>> Ideally, I'd like to do something like:
>>
>> $MY_VAR = "some value or other"
>>
>> Any of how to do this or a flat answer of you can't at the current
>> time would be gratefully received.
> 
> I know you said you didn't need it to be persistent, but I can't really 
> think of a way to do it without involving the file system. Bundle 
> commands are run in separate subshells, so there's no way to use 
> environment variables to communicate from one to the another.
> 
> Try looking at using filesystem extended attributes; do 'man xattr'. 
> These are metadata associated with individual files -- persistent, but 
> it's not a separate file somewhere.  It's a similar idea to the old 
> resource forks that MacOS used to use, but better standardized across 
> Unix filesystems. TextMate already uses extended attributes to keep the 
> caret location persistent across sessions, so at least there's 
> precedent. :-)
> 
> macduff:~/tmp/bugsdir$ ls -l bugs
> -rw-r--r--@ 1 sking  staff  202 Feb 24 11:57 bugs
> 
> macduff:~/tmp/bugsdir$ xattr -l bugs
> com.macromates.caret: {
>      column = 22;
>      line = 0;
> }
> 
> 
> 
> -- 
> Steve King
> Sr. Software Engineer
> Arbor Networks
> +1 734 821 1461
> www.arbornetworks.com <http://www.arbornetworks.com/>
> 
> 
> 
>  
> 
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
> 

-- 
View this message in context: http://old.nabble.com/Storing-variables-on-a-window-by-window-basis-tp31005440p31011886.html
Sent from the textmate users mailing list archive at Nabble.com.



More information about the textmate mailing list