Commit Graph

104 Commits

Author SHA1 Message Date
Vincent Torri 49976ca388 use eina_file_access() instead of access() if possible 2024-04-09 07:33:56 +01:00
Alastair Poole 43108e772a ecore_file: Monitor file writes (kevent).
Trigger ECORE_FILE_EVENT_MODIFIED on file write.

@fix
2021-11-25 19:20:49 +00:00
Alastair Poole 44425e7489 ecore_file_monitor: add kevent backend.
Summary:
This is a very simple kevent backend, very similar to the eio_monitor
implementation. On BSD systems, some core features within in E and
other applications are always using the poll engine, which is not
ideal.  This is better, and simpler.

Reviewers: devilhorns, raster, bu5hm4n, vtorri

Reviewed By: vtorri

Subscribers: vtorri, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12239
2021-01-31 14:45:46 +00:00
Vincent Torri 0a08a860a8 Ecore_file: on Windows, fix errno value when dst exists.
Summary: This also fixes the saving of elementary_config file

Test Plan: execution of elementary_config

Reviewers: jptiz, raster

Reviewed By: raster

Subscribers: johnny1337, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12165
2020-10-06 15:09:31 +01:00
Vincent Torri 2261332969 ecore_file_can_exec: fix .bat case
the test on the .bat file was too early

Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12122
2020-09-01 09:35:46 +02:00
Vincent Torri 45cabae42b ecore-file: fix ecore_file_can_exec() on Windows
on Windows access() has no support of X_OK (see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess?view=vs-2019), use SHGetFileInfo() instead

Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12118
2020-08-31 14:08:21 +02:00
Elyes HAOUAS 1fd0435f21 Get rid of trailing whitespaces (4 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12002
2020-06-23 10:29:14 +02:00
Marcel Hollerbach 8e3606698e refactor build
libraries are split into deps, external deps, and pub deps.
Evas engines are refactored to use the predefined engine deps.

this is preparation work for efl-one.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11806
2020-05-27 11:06:46 +02:00
Stefan Schmidt 3ca9d72825 build: lib: harmonize the use of package_c_args in all libs
Add it to subprojects which are not using it and remove and old
ELEMENTARY_BUILD define we no longer use. This allows us to have a
central place in the main meson.build file to set this variable.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11854
2020-05-26 10:15:21 +02:00
Carsten Haitzler 63b5d81983 Revert "Fix EAPI definition by defining EFL_BUILD for each built DLL"
This reverts commit 3ade45cbc8.
2020-05-18 11:13:59 +01:00
Vincent Torri 3ade45cbc8 Fix EAPI definition by defining EFL_BUILD for each built DLL
Summary: EAPI must be defined to dllexport when building DLL, and to dllimport when using these DLL. To achieve this, define EFL_BUILD for each library and module, and set DLL_EXPORT unconditionally. Static library are and will be not supported

Test Plan: compilation

Reviewers: zmike, raster, jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11834
2020-05-18 09:51:48 +01:00
Vincent Torri d135957ffa Use __func__ C99 identifier instead of __FUNCTION__ compiler extension
Summary: see http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf section 6.4.2.2 page 52

Test Plan: compilation

Reviewers: raster, devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11785
2020-05-07 09:27:07 -04:00
Carsten Haitzler 56e2e21ae7 ecore_file - address issue about false positive of finding a file in ./
it may report an exe is installed if it happens to be in cwd but cwd
isnt in path. the "full/relative" path handling case mishandled this.
fixes T8678

@fix
2020-04-22 12:51:50 +01:00
Stefan Schmidt f3d9b8ee70 esacpe: remove library from tree
This has not been used for a while and is not even buildable after our
switch to meson. It was a niche to start with given that it needed the
PS3 OS to run on. I asked for any remaining users at EDD and on the list
but heard nothing. Time to remove.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10778
2019-12-04 12:21:24 -08:00
Xavi Artigas 1c5849c5a8 doxygen: Prevent auto-linking of invalid links
Anything starting with http://, ftp:// or file:// is automatically
converted into a link by doxygen. However, we have a few instances
where we do not want this. Fortunately, doxygen allows using % to
forbid specific words from being linked.
2019-11-18 12:00:35 +01:00
Vincent Torri a5267d3d9c remove Evil.h when not necessary, include evil_private.h when necessary
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8925
2019-05-20 09:10:00 -04:00
Marcel Hollerbach e7618b7169 build: do not reply on header checking libinotify.h
but rather use the sys_bsd flag. The reason why relying on the header
existance is bad, is that bsd decided to install this header, with the
essential difference, that on bsd we require to link against libinotify,
which makes the compilation fail.

ref T7710

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D8093
2019-03-11 21:23:52 +01:00
Mike Blumenkrantz 6326e18b3f efl.file: improve api a bit
Summary:
the previous implementation/api had a number of issues:
* "file" property contained both "file" and "key" values
  - also performed file loading operation
* "load_error" property which was specific to image objects
* no methods for controlling file loading/unloading

this patch attempts the following changes:
* split "file" property into "file" and "key" properties
  - also remove "key" from existing "mmap" property
* remove "load_error"
* directly return error codes from operations
* add "load" and "unload" methods for directly controlling load state
* add implicit file loading if file/mmap is set during construction
* rewrite all efl.file implementations to move file loading into load() method
* rewrite all usage of efl.file api based on these changes
* add C extension functions to mimic previous behavior

ref T7577

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: vitor.sousa, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7577

Differential Revision: https://phab.enlightenment.org/D8018
2019-02-27 13:17:10 -05:00
Marcel Hollerbach e43f090265 cmake: remove!
This build was never complete and also was not maintained probebly.

It is also dropped in favour of meson which is cool, merged, works & is fast.

Differential Revision: https://phab.enlightenment.org/D7010
2018-12-20 20:07:26 +01:00
Marcel Hollerbach 347dc66ba9 meson: unify system properties
this unifies the system types into 4 boolean flags
This fixes the fact that meson changed the system string accross
versions.

Differential Revision: https://phab.enlightenment.org/D7144
2018-10-05 13:40:29 +02:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Myoungwoon Roy, Kim e06a9b6acf docs: Fix typos and some wrong expressions in API reference doc.
Summary: I had fixed some typos and some wrong expressions in API reference doc

Test Plan: N/A

Reviewers: raster, zmike, Hermet, segfaultxavi

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6943
2018-08-30 14:01:21 +09:00
Cedric BAIL 2894a2e3c3 ecore_file: on shutdown properly set to NULL to avoid confusion when cycling init/shutdown. 2018-05-24 16:02:20 -07:00
Cedric BAIL 33fd77e9e4 ecore: move close_on_destructor to close_on_invalidate as that describe the behavior best.
Fix all use to correctly behave on invalidate.
2018-05-01 10:39:01 -07:00
Marcel Hollerbach c705139623 ecore_file: switch from buf to tmpstr
before 	c65782b15c the acutal path has
been filled into buf, with eina_file_mkstemp the string is filled into
tmpstr, so that path should be chmoded instead of the template buf.

Thx to MatP for the report!
2018-04-10 14:27:44 +02:00
Carsten Haitzler 1c74aaa7e9 Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303b.

Revert "efl: move signal events from efl.loop to efl.app"
This reverts commit 3dbca39f98.

Revert "efl: add test suite for efl_app"
This reverts commit 3e94be5d73.

Revert "efl: create Efl.App class, the parent of Efl.Loop"
This reverts commit 28fe00b94e.

Go back to before efl.app because I think this should be done with
superclassing here not a parent object. reasons?

1. multiple loops per single thread make no sense. so if multilpe loop
objects they wont be contained in a single app object and then deleted
like this.
2. the app object is not really sharable in this design so it cant be
accessed from other threads
3. it makes it harder to get the main loop or app object (well 2 func
calls one calling the other and more typing. it is longer to type and
more work where it is not necessary, and again it can't work from
other threads unless we go duplicating efl.app per thread and then
what is the point of splittyign out the signal events from efl.loop
then?)

etc.
2018-03-03 13:40:33 +09:00
Mike Blumenkrantz 28fe00b94e efl: create Efl.App class, the parent of Efl.Loop 2018-02-26 14:02:51 -05:00
Yeshwanth Reddivari 9c191d3890 ecore_file: modify check for wd in file monitor del
Summary:
Make checks consistent in ecore_file_monitor_backend_del.
inotify_add_watch can return 0 as well on success.
So, even if wd is 0, inotify_rm_watch need to be invoked.

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5770

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-02-14 12:47:40 -08:00
Mike Blumenkrantz 7927cfefe3 ecore-file: make monitoring truly fork-safe
add a fork reset callback and attempt to preserve existing monitors
during reset

@fix
2018-02-02 16:59:44 -05:00
Vincent Torri ef0f0a50b2 Ecore_File: remove symlinks support on Windows (library and test) 2018-01-30 16:52:24 +09:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
WooHyun Jung 9fc1dd1a4e ecore_file_monitor: replace EINA_LIST_FOREACH to EINA_LIST_FOREACH_SAFE
If ecore_file_monitor_del is called inside the file monitor callback function,
eina_list found from monitor_hash would be freed. (You can check this inside
eina_hash_list_remove.)
Then, EINA_LIST_FOREACH makes one more for loop with invalid eina_list pointer.

EINA_LIST_FOREACH_SAFE can prevent from this problem.
2018-01-15 13:54:01 +09:00
Carsten Haitzler 9bedda14b3 efl loop - rename ecore_main_loop_get to efl_main_loop_get
ecore_main_loop_get() is really a new "eo api" but it's using our old
ecore_* namespace, so move to the new efl namespace.
2018-01-02 16:13:54 +09:00
Andy Williams d234458dfc Fix and simpligy windows behaviour.
Author: Vincent Torri
2017-12-31 16:08:31 +00:00
JinYong Park b05cae250c ecore_file: rename parameter for doxygen
Summary:
Some parameter's name are different in annotations and statements,
so it occurs doxygen warning.
To fix it, rename that parameters.

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D5313

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 14:02:37 -07:00
Mike Blumenkrantz 11e92cdc86 ecore-file: do not emit events when an inotify watch is removed
???????????????????????????????????????????????????????????????????????????????

@fix
2017-10-03 13:34:22 -04:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Cedric BAIL 214e22bf72 ecore_file: use new API eina_file_close_on_exec. 2017-04-18 16:56:18 -07:00
Carsten Haitzler c65782b15c ecore file - use eina_file_mkstmp to solve umask complaint
this fixes coverity CID 1039614
2017-04-18 17:30:50 +09:00
Myoungwoon Roy, Kim 8c19d9251d docs: Fix typos and some wrong expressions
Covers: Ecore_Drm, Ecore_Evas, Ecore_File, Ecore_IMF, and
Ecore_IMF_Evas API reference doxygen.

Summary: I had fixed some typos and wrong expressions, such
as capital letters, singular Etc. in Ecore_Drm, Ecore_Evas,
Ecore_File, Ecore_IMF, and Ecore_IMF_Evas API reference doxygen.

Test Plan: Doxygen Revision

Reviewers: stefan, cedric, raster, jpeg, Jaehyun_Cho

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D4680
2017-02-27 19:37:43 +09:00
Gustavo Sverzut Barbieri a679c4a322 cmake: add ecore_file. 2017-02-02 17:15:31 -02:00
Ivan Furs 12ee780653 ecore_file: add case to properly rename a file in Windows
Summary:
If the file with a new path was created and 'rename' wants to replace the old path to the new path. 'rename' will return:
   Windows 7: -1 (errno=EEXIST) (EEXIST == 17)
   Ubuntu: 0

**EEXIST**
**Ubuntu**: The link named by new is a directory that is not an empty directory. (https://linux.die.net/man/3/rename)
**Windows 7**: Files exist. An attempt has been made to create a file that already exists. For example, the _O_CREAT and _O_EXCL flags are specified in an _open call, but the named file already exists.(https://msdn.microsoft.com/en-us/library/5814770t.aspx)

Test Plan:
**Sample code to rename in Linux and Windows if the file with the new name already exists:**

int main()
{
	const char *_old = "old";
	const char *_new = "new";

	int fd1 = open(_old, O_CREAT);
	close(fd1);
	int fd2 = open(_new, O_CREAT);
	close(fd2);
	printf("rename:\t%s -> %s\n", _old, _new);
	int r = rename(_old, _new);
	if (r == 0)
	{
		printf("GOOD\n");
	}
	else
	{
		printf("CODE ERROR:\n"                  );
		printf(" -rename...: %d\n", r    );
		printf(" -errno....: %d\n", errno);
	}
	return 0;
}

Reviewers: raster, vtorri, jpeg, NikaWhite, reutskiy.v.v, an.kroitor, cedric

Reviewed By: cedric

Subscribers: artem.popov, cedric, jpeg

Tags: #efl, #windows

Differential Revision: https://phab.enlightenment.org/D4561

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-01-12 16:24:34 -08:00
Vyacheslav Reutskiy 67d228230a Revert "ecore_file: use win api for delete folder"
It was mistake, rmdir work correct, problem was fixed in commit
56c202614b

This reverts commit 5e25b8037c.
2016-11-30 14:03:00 +02:00
Gustavo Sverzut Barbieri 4b771d3e1b ecore_file_download: callback completion_cb with status=1.
When download is aborted we must call completion_cb using status == 1,
this was checked in the test suite.
2016-11-23 16:23:58 -02:00
Vyacheslav Reutskiy dc18e71903 ecore_file: get stat from correct file 2016-11-23 16:20:06 +02:00
Vyacheslav Reutskiy 5e25b8037c ecore_file: use win api for delete folder
The RemoveDirectory on Windows guarantee that given folder will be
delete.
2016-11-23 16:20:03 +02:00
Vyacheslav Reutskiy 164ece9e3f ecore_file: update docs for ecore_file_rmdir 2016-11-23 16:19:48 +02:00
Cedric BAIL 1b5e8fe3a2 ecore_file: restore past behavior and fix ecore_file_download tests. 2016-11-22 11:57:40 -08:00
Gustavo Sverzut Barbieri 02d352e1f2 ecore_file_download: use new efl_net_dialer_http.
Greatly reduce code complexity while providing better support, at
least according to @netstar efl_net_dialer_http works better than
traditional ecore_con_url on BSD.
2016-11-21 19:47:35 -02:00
Jee-Yong Um 3b4293ffa3 ecore_file/ipc: clean up documentation
Summary: move comment from c source to header and adjust ingroup relationship

Reviewers: cedric, jpeg, Hermet

Reviewed By: Hermet

Differential Revision: https://phab.enlightenment.org/D4328
2016-10-04 21:08:17 +09:00