Exemplo n.º 1
0
        public override StatStruct Stat(string path, StreamStatOptions options, StreamContext context, bool streamStat)
        {
            StatStruct invalid = new StatStruct();

            invalid.st_size = -1;
            Debug.Assert(path != null);

            // Note: path is already absolute w/o the scheme, the permissions have already been checked.
            return(PhpPath.HandleFileSystemInfo(invalid, path, (p) =>
            {
                FileSystemInfo info = null;

                info = new DirectoryInfo(p);
                if (!info.Exists)
                {
                    info = new FileInfo(p);
                    if (!info.Exists)
                    {
                        return invalid;
                    }
                }

                return BuildStatStruct(info, info.Attributes, p);
            }));
        }
Exemplo n.º 2
0
 public virtual StatStruct Stat(string path, StreamStatOptions options, StreamContext context, bool streamStat)
 {
     // int (*url_stat)(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
     return(StatUnsupported());
 }
Exemplo n.º 3
0
 /// <include file='Doc/Wrappers.xml' path='docs/method[@name="Stat"]/*'/>
 /// <remarks>
 /// <seealso cref="StreamStatOptions"/> for the list of additional options.
 /// </remarks>
 public virtual StatStruct Stat(string path, StreamStatOptions options, StreamContext context, bool streamStat)
 {
     // int (*url_stat)(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
     PhpException.Throw(PhpError.Warning, CoreResources.GetString("wrapper_op_unsupported", "Stat"));
     return(new StatStruct());
 }
Exemplo n.º 4
0
 /// <include file='Doc/Wrappers.xml' path='docs/method[@name="Stat"]/*'/>
 public override StatStruct Stat(string path, StreamStatOptions options, StreamContext context, bool streamStat)
 {
     return(proxy.Stat(path, (int)options, null, streamStat));
 }
Exemplo n.º 5
0
        public override StatStruct Stat(string path, StreamStatOptions options, StreamContext context, bool streamStat)
        {
            StatStruct invalid = new StatStruct();
            invalid.st_size = -1;
            Debug.Assert(path != null);

            // Note: path is already absolute w/o the scheme, the permissions have already been checked.
            return PhpPath.HandleFileSystemInfo(invalid, path, (p) =>
            {
                FileSystemInfo info = null;

                info = new DirectoryInfo(p);
                if (!info.Exists)
                {
                    info = new FileInfo(p);
                    if (!info.Exists)
                    {
                        return invalid;
                    }
                }

                return BuildStatStruct(info, info.Attributes, p);
            });
        }
Exemplo n.º 6
0
 public virtual StatStruct Stat(string path, StreamStatOptions options, StreamContext context, bool streamStat)
 {
     // int (*url_stat)(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
     return StatUnsupported();
 }