diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-03-15 09:22:53 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-03-15 09:22:53 (GMT) |
commit | 87085c466a1fdc5cfdb3cc6ce2659b4371c0b1b3 (patch) | |
tree | b3c42ab8f5bea31df9125fee46e42b662b44bf0d /unix/tclUnixFile.c | |
parent | 694826cd4f14b00837bf163b8e22f3c01dd2b2db (diff) | |
parent | e939996acbd004d406b55eb754fec59da94aec66 (diff) | |
download | tcl-87085c466a1fdc5cfdb3cc6ce2659b4371c0b1b3.zip tcl-87085c466a1fdc5cfdb3cc6ce2659b4371c0b1b3.tar.gz tcl-87085c466a1fdc5cfdb3cc6ce2659b4371c0b1b3.tar.bz2 |
[bug-3288345] Wrong Tcl_StatBuf used on Cygwinbug_3288345
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r-- | unix/tclUnixFile.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 2639d59..7d82d1d 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -1164,6 +1164,40 @@ TclpUtime( { return utime(Tcl_FSGetNativePath(pathPtr), tval); } +#ifdef __CYGWIN__ +int TclOSstat(const char *name, Tcl_StatBuf *statBuf) { + struct stat buf; + int result = stat(name, &buf); + statBuf->st_mode = buf.st_mode; + statBuf->st_ino = buf.st_ino; + statBuf->st_dev = buf.st_dev; + statBuf->st_rdev = buf.st_rdev; + statBuf->st_nlink = buf.st_nlink; + statBuf->st_uid = buf.st_uid; + statBuf->st_gid = buf.st_gid; + statBuf->st_size = buf.st_size; + statBuf->st_atime = buf.st_atime; + statBuf->st_mtime = buf.st_mtime; + statBuf->st_ctime = buf.st_ctime; + return result; +} +int TclOSlstat(const char *name, Tcl_StatBuf *statBuf) { + struct stat buf; + int result = lstat(name, &buf); + statBuf->st_mode = buf.st_mode; + statBuf->st_ino = buf.st_ino; + statBuf->st_dev = buf.st_dev; + statBuf->st_rdev = buf.st_rdev; + statBuf->st_nlink = buf.st_nlink; + statBuf->st_uid = buf.st_uid; + statBuf->st_gid = buf.st_gid; + statBuf->st_size = buf.st_size; + statBuf->st_atime = buf.st_atime; + statBuf->st_mtime = buf.st_mtime; + statBuf->st_ctime = buf.st_ctime; + return result; +} +#endif /* * Local Variables: |