Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6672d0c5
Kaydet (Commit)
6672d0c5
authored
Eki 07, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fileutils.c: document which encodings are used
üst
41c8b377
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
fileutils.c
Python/fileutils.c
+26
-6
No files found.
Python/fileutils.c
Dosyayı görüntüle @
6672d0c5
...
@@ -194,6 +194,9 @@ _Py_wchar2char(const wchar_t *text)
...
@@ -194,6 +194,9 @@ _Py_wchar2char(const wchar_t *text)
perhaps for cygwin/mingw builds?
perhaps for cygwin/mingw builds?
*/
*/
#if defined(HAVE_STAT) && !defined(MS_WINDOWS)
#if defined(HAVE_STAT) && !defined(MS_WINDOWS)
/* Get file status. Encode the path to the locale encoding. */
int
int
_Py_wstat
(
const
wchar_t
*
path
,
struct
stat
*
buf
)
_Py_wstat
(
const
wchar_t
*
path
,
struct
stat
*
buf
)
{
{
...
@@ -210,9 +213,11 @@ _Py_wstat(const wchar_t* path, struct stat *buf)
...
@@ -210,9 +213,11 @@ _Py_wstat(const wchar_t* path, struct stat *buf)
}
}
#endif
#endif
/* Call _wstat() on Windows, or stat() otherwise. Only fill st_mode
/* Call _wstat() on Windows, or encode the path to the filesystem encoding and
attribute on Windows. Return 0 on success, -1 on stat error or (if
call stat() otherwise. Only fill st_mode attribute on Windows.
PyErr_Occurred()) unicode error. */
Return 0 on success, -1 on _wstat() / stat() error or (if PyErr_Occurred())
unicode error. */
int
int
_Py_stat
(
PyObject
*
path
,
struct
stat
*
statbuf
)
_Py_stat
(
PyObject
*
path
,
struct
stat
*
statbuf
)
...
@@ -236,6 +241,9 @@ _Py_stat(PyObject *path, struct stat *statbuf)
...
@@ -236,6 +241,9 @@ _Py_stat(PyObject *path, struct stat *statbuf)
#endif
#endif
}
}
/* Open a file. Use _wfopen() on Windows, encode the path to the locale
encoding and use fopen() otherwise. */
FILE
*
FILE
*
_Py_wfopen
(
const
wchar_t
*
path
,
const
wchar_t
*
mode
)
_Py_wfopen
(
const
wchar_t
*
path
,
const
wchar_t
*
mode
)
{
{
...
@@ -260,9 +268,11 @@ _Py_wfopen(const wchar_t *path, const wchar_t *mode)
...
@@ -260,9 +268,11 @@ _Py_wfopen(const wchar_t *path, const wchar_t *mode)
#endif
#endif
}
}
/* Call _wfopen() on Windows, or fopen() otherwise. Return the new file
/* Call _wfopen() on Windows, or encode the path to the filesystem encoding and
object on success, or NULL if the file cannot be open or (if
call fopen() otherwise.
PyErr_Occurred()) on unicode error */
Return the new file object on success, or NULL if the file cannot be open or
(if PyErr_Occurred()) on unicode error */
FILE
*
FILE
*
_Py_fopen
(
PyObject
*
path
,
const
char
*
mode
)
_Py_fopen
(
PyObject
*
path
,
const
char
*
mode
)
...
@@ -288,6 +298,10 @@ _Py_fopen(PyObject *path, const char *mode)
...
@@ -288,6 +298,10 @@ _Py_fopen(PyObject *path, const char *mode)
}
}
#ifdef HAVE_READLINK
#ifdef HAVE_READLINK
/* Read value of symbolic link. Encode the path to the locale encoding, decode
the result from the locale encoding. */
int
int
_Py_wreadlink
(
const
wchar_t
*
path
,
wchar_t
*
buf
,
size_t
bufsiz
)
_Py_wreadlink
(
const
wchar_t
*
path
,
wchar_t
*
buf
,
size_t
bufsiz
)
{
{
...
@@ -320,6 +334,10 @@ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
...
@@ -320,6 +334,10 @@ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
#endif
#endif
#ifdef HAVE_REALPATH
#ifdef HAVE_REALPATH
/* Return the canonicalized absolute pathname. Encode path to the locale
encoding, decode the result from the locale encoding. */
wchar_t
*
wchar_t
*
_Py_wrealpath
(
const
wchar_t
*
path
,
_Py_wrealpath
(
const
wchar_t
*
path
,
wchar_t
*
resolved_path
,
size_t
resolved_path_size
)
wchar_t
*
resolved_path
,
size_t
resolved_path_size
)
...
@@ -346,6 +364,8 @@ _Py_wrealpath(const wchar_t *path,
...
@@ -346,6 +364,8 @@ _Py_wrealpath(const wchar_t *path,
}
}
#endif
#endif
/* Get the current directory. Decode the path from the locale encoding. */
wchar_t
*
wchar_t
*
_Py_wgetcwd
(
wchar_t
*
buf
,
size_t
size
)
_Py_wgetcwd
(
wchar_t
*
buf
,
size_t
size
)
{
{
...
...
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