Browse Source

Add in missing stat element and fix win32 build

PEAR_1_4DEV
Sara Golemon 23 years ago
parent
commit
e9a1d12f71
  1. 8
      ext/standard/ftp_fopen_wrapper.c

8
ext/standard/ftp_fopen_wrapper.c

@ -760,6 +760,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
}
ssb->sb.st_ino = 0; /* Unknown values */
ssb->sb.st_dev = 0;
ssb->sb.st_uid = 0;
ssb->sb.st_gid = 0;
ssb->sb.st_atime = -1;
@ -767,9 +768,12 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
ssb->sb.st_ctime = -1;
ssb->sb.st_nlink = 1;
ssb->sb.st_rdev = -1;
#ifdef HAVE_ST_BLKSIZE
ssb->sb.st_blksize = 4096; /* Guess since FTP won't expose this information */
ssb->sb.st_blocks = ceil(ssb->sb.st_size / ssb->sb.st_blksize);
#ifdef HAVE_ST_BLOCKS
ssb->sb.st_blocks = (int)((4095 + ssb->sb.st_size) / ssb->sb.st_blksize); /* emulate ceil */
#endif
#endif
php_stream_close(stream);
php_url_free(resource);
return 0;

Loading…
Cancel
Save