Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
dd44887a
Commit
dd44887a
authored
Sep 23, 2011
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implment p_access and use it in git_fileutils_exists
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
parent
01ab592b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
src/fileops.c
+1
-1
src/posix.h
+1
-0
src/win32/posix.h
+1
-1
src/win32/posix_w32.c
+11
-0
No files found.
src/fileops.c
View file @
dd44887a
...
@@ -127,7 +127,7 @@ int git_futils_isfile(const char *path)
...
@@ -127,7 +127,7 @@ int git_futils_isfile(const char *path)
int
git_futils_exists
(
const
char
*
path
)
int
git_futils_exists
(
const
char
*
path
)
{
{
assert
(
path
);
assert
(
path
);
return
access
(
path
,
F_OK
);
return
p_
access
(
path
,
F_OK
);
}
}
git_off_t
git_futils_filesize
(
git_file
fd
)
git_off_t
git_futils_filesize
(
git_file
fd
)
...
...
src/posix.h
View file @
dd44887a
...
@@ -52,6 +52,7 @@ extern char* p_getenv(const char* name);
...
@@ -52,6 +52,7 @@ extern char* p_getenv(const char* name);
#define p_chdir(p) chdir(p)
#define p_chdir(p) chdir(p)
#define p_rmdir(p) rmdir(p)
#define p_rmdir(p) rmdir(p)
#define p_chmod(p,m) chmod(p, m)
#define p_chmod(p,m) chmod(p, m)
#define p_access(p,m) access(p,m)
#endif
#endif
...
...
src/win32/posix.h
View file @
dd44887a
...
@@ -43,6 +43,6 @@ extern int p_stat(const char* path, struct stat* buf);
...
@@ -43,6 +43,6 @@ extern int p_stat(const char* path, struct stat* buf);
extern
int
p_chdir
(
const
char
*
path
);
extern
int
p_chdir
(
const
char
*
path
);
extern
int
p_chmod
(
const
char
*
path
,
int
mode
);
extern
int
p_chmod
(
const
char
*
path
,
int
mode
);
extern
int
p_rmdir
(
const
char
*
path
);
extern
int
p_rmdir
(
const
char
*
path
);
extern
int
p_access
(
const
char
*
path
,
int
mode
);
#endif
#endif
src/win32/posix_w32.c
View file @
dd44887a
...
@@ -401,3 +401,14 @@ int p_setenv(const char* name, const char* value, int overwrite)
...
@@ -401,3 +401,14 @@ int p_setenv(const char* name, const char* value, int overwrite)
return
(
SetEnvironmentVariableA
(
name
,
value
)
==
0
?
GIT_EOSERR
:
GIT_SUCCESS
);
return
(
SetEnvironmentVariableA
(
name
,
value
)
==
0
?
GIT_EOSERR
:
GIT_SUCCESS
);
}
}
int
p_access
(
const
char
*
path
,
int
mode
)
{
wchar_t
*
buf
=
conv_utf8_to_utf16
(
path
);
int
ret
;
ret
=
_waccess
(
buf
,
mode
);
free
(
buf
);
return
ret
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment