Page MenuHomePhabricator

eio: path and filename property should always remind accessible even in case of error.
AcceptedPublic

Authored by cedric on Wed, Mar 13, 2:58 PM.

Diff Detail

Repository
rEFL core/efl
Branch
devs/cedric/fileselector
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 10510
cedric created this revision.Wed, Mar 13, 2:58 PM
cedric updated this revision to Diff 20647.Fri, Mar 15, 4:58 PM
cedric added a reviewer: YOhoho.

Rebase.

This commit does a little bit more than it describes. It also makes all the properties "direct_info", "mtime", "atime", "ctime", "is_dir", "is_lnk", "size", "stat" accessable. So as long as they have a value, this value is returned. Which also means when _eio_build_st is called twice, and the first one succeeds, and the second does not. Then the old value is returned i think ? All in all, should we make pd->st = NULL and pd->info = NULL; in case of an error ?

bu5hm4n requested changes to this revision.Sat, Mar 16, 8:59 AM
This revision now requires changes to proceed.Sat, Mar 16, 8:59 AM

This commit does a little bit more than it describes. It also makes all the properties "direct_info", "mtime", "atime", "ctime", "is_dir", "is_lnk", "size", "stat" accessable. So as long as they have a value, this value is returned. Which also means when _eio_build_st is called twice, and the first one succeeds, and the second does not. Then the old value is returned i think ? All in all, should we make pd->st = NULL and pd->info = NULL; in case of an error ?

All of this property where already doing an :

if (pd->error)
  return eina_value_error_new(pd->error);

So if we were able to get a proper value, we would return it first, then we would return a general error, before doing anything else. So I don't think it does more just it give a chance for some things to succeed without limiting things to just be in error.

bu5hm4n accepted this revision.Thu, Mar 21, 2:31 AM

_eio_build_st is protecting itself from doing what I wrote above, it just feels a little bit fragile, since changing this would leave the world in parts, maybe make pd->st = NULL and pd->info = NULL; in case of an error ?

This revision is now accepted and ready to land.Thu, Mar 21, 2:31 AM

_eio_build_st is protecting itself from doing what I wrote above, it just feels a little bit fragile, since changing this would leave the world in parts, maybe make pd->st = NULL and pd->info = NULL; in case of an error ?

I kind of want to avoid that as this would mean that even when you were able to fetch some information you would make the entire object fail. I am still not sure on how to make it partially fail and be able to fetch the data that aren't failing after there was a fail.