|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-04-10 11:00 UTC] zeev
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 16:00:02 2025 UTC |
I try using the -f option to parse a file, and it reads it in from stdin instead. I believe this is due to php3_fopen_for_parser: small bug, but eh. #ifndef S_ISREG #define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) #endif if (fp && (0 > fstat (fileno (fp), &st) || !S_ISREG(st.st_mode))) { fclose (fp); fp = NULL; } the S_ISREG might be wrong under Win32: Get information about an open file. int _fstat( int handle, struct _stat *buffer ); __int64 _fstati64( int handle, struct _stat *buffer ); Remarks The _fstat function obtains information about the open file associated with handle and stores it in the structure pointed to by buffer. The _stat structure, defined in SYS\STAT.H, contains the following fields: st_atime Time of last file access. st_ctime Time of creation of file. st_dev If a device, handle; otherwise 0. st_mode Bit mask for file-mode information. The _S_IFCHR bit is set if handle refers to a device. The _S_IFREG ***************underscore? bit is set if handle refers to an ordinary file. The read/write bits are set according to the file?s permission mode. _S_IFCHR and other constants are defined in SYS\STAT.H. st_mtime Time of last modification of file. st_nlink Always 1 on non-NTFS file systems. st_rdev If a device, handle; otherwise 0. st_size Size of the file in bytes. If handle refers to a device, the st_atime, st_ctime, and st_mtime and st_size fields are not meaningful. Because STAT.H uses the _dev_t type, which is defined in TYPES.H, you must include TYPES.H before STAT.H in your code.