Commit Graph

32 Commits

Author SHA1 Message Date
Vincent Torri 86b5ea5af8 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-08 10:10:30 +02: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
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 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
Vincent Torri ef0f0a50b2 Ecore_File: remove symlinks support on Windows (library and test) 2018-01-30 16:52:24 +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
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
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
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
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
Vincent Torri 68107e5eb8 Ecore_File: fix merge and simplify logic in ecore_file_file_get() on WindoWS
Summary: Ecore_File: fix merge and simplify logic in ecore_file_file_get() on WindowS

Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3404
2015-12-07 14:08:19 +09:00
Vincent Torri 892df20bd4 ecore_file: fix ecore_file_file_get() on Windows
@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 11:35:24 -08:00
Jaehyun Cho 39f154f8ca ecore_file: Fix ecore_file_file_get function on Windows.
On Windows, both backslash and slash can be used as file path
separators. Therefore, it is fixed to consider backslash as a file path
separator as well on Windows.

@fix
2015-11-02 10:32:10 +09:00
Vincent Torri b72be67388 ecore_file: remove whitespaces
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri b9ed3375f2 ecore_file: fix ecore_file management function on Windows
On windows, stat() returns -1 if a path is finished with a \ or /,
so replace all stat() calls with a function which removes the trailing
slash or backslash on Windows

At this stage the code duplicate many code path for avoiding potential
borkage on Unix system. During 1.17 release cycle, it would be nice to
refactor this piece.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri 315e1f5a2b Ecore_File: use ecore_file_mkdir() 2015-07-03 16:23:06 +01:00
Vincent Torri 308dbff141 Ecore_File: better implementation of ecore_file_mkdir() 2015-07-03 16:23:06 +01:00
Vincent Torri a46adde19d Ecore_File: improve comment of ecore_file_mkdir() 2015-07-03 16:23:06 +01:00
Cedric BAIL 241d0d3e18 ecore_file: use portable environment lookup. 2015-05-14 18:41:48 +02:00
Carsten Haitzler 4e716fb779 ecore_file - fix nasty memory issues in ecore_file_app_exe_get()
valgrind was most unhappy with ecore_file_app_exe_get(). like:

==8331== Invalid write of size 1
==8331==    at 0x68DE90A: ecore_file_app_exe_get (ecore_file.c:994)
==8331==  Address 0x1348e58f is 0 bytes after a block of size 31 alloc'd
==8331==    at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==8331== Invalid write of size 1
==8331==    at 0x68DE948: ecore_file_app_exe_get (ecore_file.c:1000)
==8331==  Address 0x1348e599 is 10 bytes after a block of size 31 alloc'd
==8331==    at 0x4C28C20: malloc (vg_replace_malloc.c:296)

etc. etc. - so i rewrote it cleanly using strbuf to save code and
effort. cleaner now and ACTUALLY works correctly... and no valgrind
complaints.

@fix
2015-04-01 09:37:27 +09:00
kabeer khan 9c26b572d0 ecore_file : Changed documentation of ecore_file_mksubdirs
Summary:
Corrected documentation of ecore_file_mksubdirs by replacing dirs with subdirs

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1674
2014-11-21 09:17:31 -05:00
Stefan Schmidt 40b395666b ecore_file: Check return value of chmod()
Handle the error case here if chmod() fails.

CID: 1039696
2014-08-08 11:28:57 +02:00
Sebastian Dransfeld 35240d979a ecore: remove dead free
Since we now free exe on goto restart, exe will always be NULL.

CID 1139955
2013-12-23 13:39:47 +01:00
Carsten Haitzler f1fa8de149 ecore-file - fix mem leak in ecore_file_app_exe_get() on restart
this actually fixes the issue. coverity did point it out but i fixed
it incorrectly. since it was still there in the scan i now fixed it
properly. fixes CID 1039279
2013-12-15 11:18:38 +09:00
Carsten Haitzler f8b5dcf126 ecore_file - finding exe path - if HOME is not set a leak could happen
this fixes CID 1039279
2013-12-13 21:26:05 +09:00
Jihoon Kim 49511730d7 fix unchecked return value of stat in ecore_file_mv
stat() function may fail and return an error code

This fixes CID 1039697
2013-12-02 09:40:48 +09:00
Oleksandr Shcherbina 1cad4c2afe ecore/ecore_file: NULL-check for input parameter
Add check by NULL for input parameter 'path' in method ecore_file_mkpath

Reviewers: seoz, Hermet

CC: cedric

Differential Revision: https://phab.enlightenment.org/D349
2013-11-30 13:50:17 +09:00
Vincent Torri 7d6010b12c merge: add escape ecore, fix several bugs
SVN revision: 79995
2012-12-02 22:35:45 +00:00