internal void Refresh(bool force)
        {
            if (this.valid && !force)
            {
                return;
            }
            MonoIOError monoIOError;

            MonoIO.GetFileStat(this.FullName, out this.stat, out monoIOError);
            this.valid = true;
            this.InternalRefresh();
        }
Exemple #2
0
        // internal

        internal void Refresh(bool force)
        {
            if (valid && !force)
            {
                return;
            }

            MonoIOError error;

            MonoIO.GetFileStat(FullName, out stat, out error);

            /* Don't throw on error here, too much other
             * stuff relies on it not doing so...
             */

            valid = true;

            InternalRefresh();
        }
Exemple #3
0
        internal static int FillAttributeInfo(String path, ref MonoIOStat data, bool tryagain, bool returnErrorOnNotFound)
        {
            if (tryagain)
            {
                throw new NotImplementedException();
            }

            MonoIOError error;

            MonoIO.GetFileStat(path, out data, out error);

            if (!returnErrorOnNotFound && (error == MonoIOError.ERROR_FILE_NOT_FOUND || error == MonoIOError.ERROR_PATH_NOT_FOUND || error == MonoIOError.ERROR_NOT_READY))
            {
                data = default(MonoIOStat);
                data.fileAttributes = (FileAttributes)(-1);
                return(0);
            }

            return((int)error);
        }
Exemple #4
0
        public static DateTime GetLastWriteTime(string path)
        {
            MonoIOStat  stat;
            MonoIOError error;

            Path.Validate(path);
            SecurityManager.EnsureElevatedPermissions();              // this is a no-op outside moonlight

            if (!MonoIO.GetFileStat(path, out stat, out error))
            {
                if (error == MonoIOError.ERROR_PATH_NOT_FOUND || error == MonoIOError.ERROR_FILE_NOT_FOUND)
                {
                    return(DefaultLocalFileTime);
                }
                else
                {
                    throw new IOException(path);
                }
            }
            return(DateTime.FromFileTime(stat.LastWriteTime));
        }
Exemple #5
0
        public static DateTime GetLastWriteTime(string path)
        {
            MonoIOStat  stat;
            MonoIOError error;

            CheckPathExceptions(path);

            if (!MonoIO.GetFileStat(path, out stat, out error))
            {
#if NET_2_0
                if (error == MonoIOError.ERROR_PATH_NOT_FOUND || error == MonoIOError.ERROR_FILE_NOT_FOUND)
                {
                    return(DefaultLocalFileTime);
                }
                else
                {
                    throw new IOException(path);
                }
#else
                throw CreatePartOfPathNotFoundException(path);
#endif
            }
            return(DateTime.FromFileTime(stat.LastWriteTime));
        }