コード例 #1
0
ファイル: notmuch.go プロジェクト: vlmarek/notmuch-solaris
/* Get a filename for the email corresponding to 'message'.
 *
 * The returned filename is an absolute filename, (the initial
 * component will match notmuch_database_get_path() ).
 *
 * The returned string belongs to the message so should not be
 * modified or freed by the caller (nor should it be referenced after
 * the message is destroyed).
 *
 * Note: If this message corresponds to multiple files in the mail
 * store, (that is, multiple files contain identical message IDs),
 * this function will arbitrarily return a single one of those
 * filenames.
 */
func (self *Message) GetFileName() string {
	if self.message == nil {
		return ""
	}
	fname := C.notmuch_message_get_filename(self.message)
	// we dont own fname
	// defer C.free(unsafe.Pointer(fname))

	if fname == nil {
		return ""
	}

	return C.GoString(fname)
}
コード例 #2
0
ファイル: message.go プロジェクト: gmuch/gmuch
// Filename returns the absolute path of the email message.
//
// Note: If this message corresponds to multiple files in the mail store, (that
// is, multiple files contain identical message IDs), this function will
// arbitrarily return a single one of those filenames. See Filenames for
// returning the complete list of filenames.
func (m *Message) Filename() string {
	return C.GoString(C.notmuch_message_get_filename(m.toC()))
}