Go to the FreeLists Home Page Home Signup Help Login
 



[openbeosstorage] || [Date Prev] [03-2002 Date Index] [Date Next] || [Thread Prev] [03-2002 Thread Index] [Thread Next]

[openbeosstorage] Re: Quickie...

  • From: Tyler Dauwalder <tyler@xxxxxxxxxxxxx>
  • To: openbeosstorage@xxxxxxxxxxxxx
  • Date: Thu, 28 Mar 2002 23:54:01 +0000
Thanks for the update :-)

> So any code put into the CVS between now and when I get a net connection at
> home will be untested and might not conform 100% to the Open Tracker code
> guild lines. If anyone objects to this, I'll wait until I have a connection
> at home before checking it in, but I really don't think it'll effect anyone
> but me, as by the time I get a release-worthy version I will of tested it
> all, and formatted the code.

That's fine with me. You might take NodeInfo.cpp out of the libstorage listing 
in source/lib/Jamfile, just on the off chance that somebody slurps the 
storage_kit folder out of CVS and tries to compile it and doesn't understand 
why they get a bunch of errors from NodeInfo, but otherwise don't worry about 
it.

> Right so what I am actually up to, well I?m currently working on BNodeInfo
> and the BStatables tests. However I?ve hit a block on BNodeInfo.
> GetType(char *type) returns the MIME type for a file, which (as I understand 
> > it) checks the attribute BEOS:TYPE then if this does not exist will check
> the file extension,

I don't think it checks the file extension. The NodeInfo docs say that it's 
only a wrapper around attribute calls. I also wrote a little program to double 
check (attached). It creates a new text file called "test.txt" and then gets 
the MIME type for it. It initially returns an error code, B_ENTRY_NOT_FOUND, 
which I believe is what ReadAttr() would return if you tried to read an 
attribute that didn't exist. If you then Identify the file from Tracker and run 
the program again, it'll get "text/plain" like you'd expect.

As best I can tell, you can only get a pathname from a Node if it's a directory 
in R5. You can make an entry ref using a directory's node ref and the filename 
".", but if you try a similar thing using a regular file's node ref, you get an 
error.

On the other hand, I don't see why we couldn't do that with our own kernel when 
the time comes. That might be a nice feature to add (having NodeInfo objects 
decipher the type from the extension if the attribute doesn't exist). For now 
though, I guess just do what the R5 version does.

-Tyler

-- Binary/unsupported file stripped by Ecartis --
-- Type: text/x-source-code
-- File: NodeInfoTest.cpp







[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.