throw-away-1 at macromates.com
Fri Apr 13 12:03:36 UTC 2007
On 12. Apr 2007, at 06:48, Adam Elliot wrote:
> Thank you very much, this is exactly what I was looking for!
The bookmarks are stored under the com.macromates.bookmarked_lines
It is an array of line numbers (stored as a property list).
One caveat is that it is (likely) gzipped -- the reason for this is
that extended attributes has a size limitation, and I did run into
that when storing the values as their “raw” property lists.
There is no indicator of this, so you need to fetch the value, try to
decompress is, and if that succeeds, parse it as a plist, otherwise
try parse the raw value as a plist -- here is the code I use:
ssize_t len = getxattr(path, key, NULL, 0, 0, 0);
if(len <= 0)
if(getxattr(path, key, &v, v.size(), 0, 0) != -1)
uLongf destLen = 5 * v.size();
int zlib_res = Z_BUF_ERROR;
while(zlib_res == Z_BUF_ERROR && destLen < 1024*1024)
destLen <<= 2;
dest = std::vector<char>(destLen);
zlib_res = uncompress((Bytef*)&dest, &destLen,
if(zlib_res == Z_OK)
res = [NSPropertyListSerialization propertyListFromData:
[NSData dataWithBytes:&v length:v.size()]
> On 11-Apr-07, at 9:13 PM, Benoit Gagnon wrote:
>> from the TextMate help:
>> "19.4 Extended Attributes (Metadata)
>> Starting with Tiger, OS X supports setxattr and friends.
>> TextMate makes use of extended attributes to store the carets
>> position, bookmarks, what text is folded and is likely to make
>> use of extended attributes in the future."
>> and from this site you should find useful information on how to
>> get to
>> the values:
>> On 4/11/07, Adam Elliot <adam.elliot at gmail.com> wrote:
>>> Is there a way to access the bookmarks added to a file so they
>>> can be
>>> used in a bundle for adding break points to a debugger?
>>> textmate-dev mailing list
>>> textmate-dev at lists.macromates.com
>> textmate-dev mailing list
>> textmate-dev at lists.macromates.com
> textmate-dev mailing list
> textmate-dev at lists.macromates.com
More information about the textmate-dev