mail-archives/monodroid/2013-July/013855.html

107 строки
4.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE> [mono-android] Can't set CreationTime on File
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=Re%3A%20%5Bmono-android%5D%20Can%27t%20set%20CreationTime%20on%20File&In-Reply-To=%3C51EE6B5D.1090909%40all-the-johnsons.co.uk%3E">
<META NAME="robots" CONTENT="index,nofollow">
<style type="text/css">
pre {
white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
}
</style>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="013854.html">
<LINK REL="Next" HREF="013875.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[mono-android] Can't set CreationTime on File</H1>
<B>Paul Johnson</B>
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=Re%3A%20%5Bmono-android%5D%20Can%27t%20set%20CreationTime%20on%20File&In-Reply-To=%3C51EE6B5D.1090909%40all-the-johnsons.co.uk%3E"
TITLE="[mono-android] Can't set CreationTime on File">paul at all-the-johnsons.co.uk
</A><BR>
<I>Tue Jul 23 11:39:09 UTC 2013</I>
<P><UL>
<LI>Previous message: <A HREF="013854.html">[mono-android] Can't set CreationTime on File
</A></li>
<LI>Next message: <A HREF="013875.html">[mono-android] Can't set CreationTime on File
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#13855">[ date ]</a>
<a href="thread.html#13855">[ thread ]</a>
<a href="subject.html#13855">[ subject ]</a>
<a href="author.html#13855">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hi,
&gt;<i> I think, the following code worked in the past but now I get an error when
</I>&gt;<i> setting the timestamps (Invalide Parameter).
</I>&gt;<i>
</I>&gt;<i> FileInfo fi = new FileInfo(file);
</I>&gt;<i> fi.Attributes = FileAttributes.Normal; &lt;-works
</I>&gt;<i> fi.CreationTime = timeCreate; &lt;-fail
</I>&gt;<i> fi.LastWriteTime = timeLastWrite; &lt;-fail
</I>&gt;<i> fi.LastAccessTime = timeLastWrite; &lt;-fail
</I>&gt;<i> fi = null;
</I>&gt;<i>
</I>&gt;<i> My mono-version hasn't changed (still 4.2.7) for month, now.
</I>&gt;<i> Has google something changed in Android that prevents changing filetimes?
</I>
Can you create a small test case showing the problem? If you've not
changed anything, the code should still work.
4.2.7 of Xamarin.Android is really old (the alpha version is on 4.8.0
with the stable being 4.6.8) and all of them IIRC use the mono-3 branch now.
You might want to try
fi.CreationTime = timeCreate.TimeOfDay;
as well
Paul
--
&quot;Voila! In view humble vaudevillian veteran, cast vicariously as both
victim and villain by the vicissitudes of fate. This visage, no mere
veneer of vanity, is a vestige of the &#8220;vox populi&#8221; now vacant, vanished.
However, this valorous visitation of a bygone vexation stands vivified,
and has vowed to vanquish these venal and virulent vermin, van guarding
vice and vouchsafing the violently vicious and voracious violation of
volition.
The only verdict is vengeance; a vendetta, held as a votive not in vain,
for the value and veracity of such shall one day vindicate the vigilant
and the virtuous.
Verily this vichyssoise of verbiage veers most verbose, so let me simply
add that it&#8217;s my very good honour to meet you and you may call me V..&quot;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="013854.html">[mono-android] Can't set CreationTime on File
</A></li>
<LI>Next message: <A HREF="013875.html">[mono-android] Can't set CreationTime on File
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#13855">[ date ]</a>
<a href="thread.html#13855">[ thread ]</a>
<a href="subject.html#13855">[ subject ]</a>
<a href="author.html#13855">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
mailing list</a><br>
</body></html>