private GMime.Message GetGMimeMessage(string file, int offset, int size)
        {
            GMime.Message msg = null;

            if (!File.Exists(file))
            {
                return(null);
            }

            StreamFs stream = null;
            Parser   parser = null;

            try {
                int fd = Syscall.open(file, OpenFlags.O_RDONLY);
                stream = new StreamFs(fd, offset, offset + size);
                parser = new Parser(stream);
                msg    = parser.ConstructMessage();
            } catch {
            } finally {
                if (stream != null)
                {
                    stream.Dispose();
                }
                if (parser != null)
                {
                    parser.Dispose();
                }
            }

            return(msg);
        }
Example #2
0
            private GMime.Message FullMessage()
            {
                int    fd;
                string file = Thunderbird.GetFullyIndexableFile(workfile);

                GMime.Message message = null;

                // gmime will go nuts and make the daemon "segmentation fault" in case the file doesn't exist!
                if (!File.Exists(file))
                {
                    return(message);
                }

                try {
                    fd = Mono.Unix.Native.Syscall.open(file, Mono.Unix.Native.OpenFlags.O_RDONLY);
                    StreamFs stream = new StreamFs(fd, Offset, Offset + Size);
                    Parser   parser = new Parser(stream);
                    message = parser.ConstructMessage();

                    stream.Dispose();
                    parser.Dispose();
                } catch {}

                return(message);
            }
		private GMime.Message GetGMimeMessage (string file, int offset, int size)
		{
			GMime.Message msg = null;
			
			if (!File.Exists (file))
				return null;
				
			StreamFs stream = null;
			Parser parser = null;
			try {
				int fd = Syscall.open (file, OpenFlags.O_RDONLY);
				stream = new StreamFs (fd, offset, offset + size);
				parser = new Parser (stream);
				msg = parser.ConstructMessage ();
			} catch {
			} finally {
				if (stream != null)
					stream.Dispose ();
				if (parser != null)
					parser.Dispose ();
			}
			
			return msg;
		}
Example #4
0
			private GMime.Message FullMessage ()
			{
				int fd;
				string file = Thunderbird.GetFullyIndexableFile (workfile);
				GMime.Message message = null;

				// gmime will go nuts and make the daemon "segmentation fault" in case the file doesn't exist!
				if (!File.Exists (file))
					return message;

				try {
					fd = Mono.Unix.Native.Syscall.open (file, Mono.Unix.Native.OpenFlags.O_RDONLY);
					StreamFs stream = new StreamFs (fd, Offset, Offset + Size);
					Parser parser = new Parser (stream);
					message = parser.ConstructMessage ();
				
					stream.Dispose ();
					parser.Dispose ();
				} catch {}

				return message;
			}