Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
提交
a07174d7
O
oneflow
项目概览
Oneflow-Inc
/
oneflow
上一次同步 接近 3 年
通知
13
Star
2733
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oneflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a07174d7
编写于
9月 21, 2017
作者:
C
chengtbf
提交者:
Will Zhang
9月 21, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix Windows for DeleteFile macro and Socket lib (#359)
上级
85d6a2ec
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
11 addition
and
15 deletion
+11
-15
cmake/third_party.cmake
cmake/third_party.cmake
+1
-0
oneflow/core/persistence/file_system.cpp
oneflow/core/persistence/file_system.cpp
+1
-1
oneflow/core/persistence/file_system.h
oneflow/core/persistence/file_system.h
+2
-5
oneflow/core/persistence/hadoop/hadoop_file_system.cpp
oneflow/core/persistence/hadoop/hadoop_file_system.cpp
+1
-1
oneflow/core/persistence/hadoop/hadoop_file_system.h
oneflow/core/persistence/hadoop/hadoop_file_system.h
+1
-1
oneflow/core/persistence/posix/posix_file_system.cpp
oneflow/core/persistence/posix/posix_file_system.cpp
+1
-1
oneflow/core/persistence/posix/posix_file_system.h
oneflow/core/persistence/posix/posix_file_system.h
+1
-1
oneflow/core/persistence/snapshot.cpp
oneflow/core/persistence/snapshot.cpp
+1
-1
oneflow/core/persistence/windows/windows_file_system.cpp
oneflow/core/persistence/windows/windows_file_system.cpp
+1
-1
oneflow/core/persistence/windows/windows_file_system.h
oneflow/core/persistence/windows/windows_file_system.h
+1
-3
未找到文件。
cmake/third_party.cmake
浏览文件 @
a07174d7
...
...
@@ -40,6 +40,7 @@ set(oneflow_third_party_libs
if
(
WIN32
)
# static gflags lib requires "PathMatchSpecA" defined in "ShLwApi.Lib"
list
(
APPEND oneflow_third_party_libs
"ShLwApi.Lib"
)
list
(
APPEND oneflow_third_party_libs
"Ws2_32.lib"
)
endif
()
set
(
oneflow_third_party_dependencies
...
...
oneflow/core/persistence/file_system.cpp
浏览文件 @
a07174d7
...
...
@@ -45,7 +45,7 @@ void FileSystem::RecursivelyDeleteDir(const std::string& dirname) {
}
else
{
// Delete file might fail because of permissions issues or might be
// unimplemented.
Del
ete
File
(
child_path
);
DelFile
(
child_path
);
}
}
}
...
...
oneflow/core/persistence/file_system.h
浏览文件 @
a07174d7
...
...
@@ -4,10 +4,6 @@
#include "oneflow/core/common/util.h"
#include "oneflow/core/persistence/platform.h"
#if defined(_WIN32)
#undef DeleteFile
#endif
namespace
oneflow
{
namespace
fs
{
...
...
@@ -114,7 +110,8 @@ class FileSystem {
virtual
std
::
vector
<
std
::
string
>
ListDir
(
const
std
::
string
&
dir
)
=
0
;
// Deletes the named file.
virtual
void
DeleteFile
(
const
std
::
string
&
fname
)
=
0
;
// Using DelFile to avoid Windows macro
virtual
void
DelFile
(
const
std
::
string
&
fname
)
=
0
;
// Creates the specified directory.
virtual
void
CreateDir
(
const
std
::
string
&
dirname
)
=
0
;
...
...
oneflow/core/persistence/hadoop/hadoop_file_system.cpp
浏览文件 @
a07174d7
...
...
@@ -330,7 +330,7 @@ std::vector<std::string> HadoopFileSystem::ListDir(const std::string& dir) {
return
result
;
}
void
HadoopFileSystem
::
Del
ete
File
(
const
std
::
string
&
fname
)
{
void
HadoopFileSystem
::
DelFile
(
const
std
::
string
&
fname
)
{
hdfsFS
fs
=
nullptr
;
CHECK
(
Connect
(
&
fs
));
PCHECK
(
hdfs_
->
hdfsDelete
(
fs
,
TranslateName
(
fname
).
c_str
(),
/*recursive=*/
0
)
...
...
oneflow/core/persistence/hadoop/hadoop_file_system.h
浏览文件 @
a07174d7
...
...
@@ -78,7 +78,7 @@ class HadoopFileSystem final : public FileSystem {
std
::
vector
<
std
::
string
>
ListDir
(
const
std
::
string
&
dir
)
override
;
void
Del
ete
File
(
const
std
::
string
&
fname
)
override
;
void
DelFile
(
const
std
::
string
&
fname
)
override
;
void
CreateDir
(
const
std
::
string
&
dirname
)
override
;
...
...
oneflow/core/persistence/posix/posix_file_system.cpp
浏览文件 @
a07174d7
...
...
@@ -125,7 +125,7 @@ std::vector<std::string> PosixFileSystem::ListDir(const std::string& dir) {
return
result
;
}
void
PosixFileSystem
::
Del
ete
File
(
const
std
::
string
&
fname
)
{
void
PosixFileSystem
::
DelFile
(
const
std
::
string
&
fname
)
{
PCHECK
(
unlink
(
TranslateName
(
fname
).
c_str
())
==
0
)
<<
"Fail to delete file "
<<
fname
;
}
...
...
oneflow/core/persistence/posix/posix_file_system.h
浏览文件 @
a07174d7
...
...
@@ -28,7 +28,7 @@ class PosixFileSystem final : public FileSystem {
std
::
vector
<
std
::
string
>
ListDir
(
const
std
::
string
&
dir
)
override
;
void
Del
ete
File
(
const
std
::
string
&
fname
)
override
;
void
DelFile
(
const
std
::
string
&
fname
)
override
;
void
CreateDir
(
const
std
::
string
&
dirname
)
override
;
...
...
oneflow/core/persistence/snapshot.cpp
浏览文件 @
a07174d7
...
...
@@ -70,7 +70,7 @@ void Snapshot::ConcatLbnFile(const std::string& lbn, int32_t part_num,
out_stream
.
Write
(
buffer
,
n
);
offset
+=
n
;
}
GlobalFS
()
->
Del
ete
File
(
part_file_path
);
GlobalFS
()
->
DelFile
(
part_file_path
);
}
}
GlobalFS
()
->
DeleteDir
(
part_dir
);
...
...
oneflow/core/persistence/windows/windows_file_system.cpp
浏览文件 @
a07174d7
...
...
@@ -222,7 +222,7 @@ std::vector<std::string> WindowsFileSystem::ListDir(const std::string& dir) {
return
result
;
}
void
WindowsFileSystem
::
Del
ete
File
(
const
std
::
string
&
fname
)
{
void
WindowsFileSystem
::
DelFile
(
const
std
::
string
&
fname
)
{
std
::
wstring
file_name
=
Utf8ToWideChar
(
fname
);
PCHECK
(
_wunlink
(
file_name
.
c_str
())
==
0
)
<<
"Failed to delete a file: "
+
fname
;
...
...
oneflow/core/persistence/windows/windows_file_system.h
浏览文件 @
a07174d7
...
...
@@ -7,8 +7,6 @@
#include <Windows.h>
#undef DeleteFile
namespace
oneflow
{
namespace
fs
{
...
...
@@ -32,7 +30,7 @@ class WindowsFileSystem final : public FileSystem {
std
::
vector
<
std
::
string
>
ListDir
(
const
std
::
string
&
dir
)
override
;
void
Del
ete
File
(
const
std
::
string
&
fname
)
override
;
void
DelFile
(
const
std
::
string
&
fname
)
override
;
void
CreateDir
(
const
std
::
string
&
dirname
)
override
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录