You did say what error you are getting but if it's eFilerError,
most likely you're running your code in a new/unsaved drawing.
If I check for an unsaved drawing, the code works find.
Sorry but I only know C#.
int title = Convert.ToInt32(AcadApp.GetSystemVariable("DWGTITLED"));
if (title > 0 )
{
string path = h_app.FindFile(doc.Name, doc.Database, FindFileHint.Default);
FileInfo info
= new FileInfo
(path
); size = info.Length;
ed.WriteMessage("\nPath: " + path);
ed.WriteMessage("\nFileSize: " + size);
}
else
{
ed.WriteMessage("\nFile not found");
}