How do I set a file's last write time in via .NET Compact Framework ?

  • Thread starter Thread starter JuLiE Dxer
  • Start date Start date
J

JuLiE Dxer

Is there a way to set a file's last write time via a .NET Compact
Framework support method?

The System.IO.File class has

GetLastWriteTime
SetLastWriteTime

but only the GetLastWriteTime is supported under the .NET Compact
Framework :(

I'm puzzled.

Thanks,

MsJ
 
Take a look at the OpenNETCF.IO.FileEx class

www.opennetcf.org/sdf

-Chris

Is this the only way? Isn't there any access to such file attributes
available via the .NET Compact Framework? Perhaps, via calls the WinCE
API? I'm having a feeling that OpenNETCF.IO.FileEx will not be a
viable option.

MsJ
 
Did you look at FileEx?
http://www.opennetcf.org/SourceBrow...InetPub/wwwroot/Source/OpenNETCF/IO/FileEx.cs

If using it as a black box is not a "viable option", you can always borrow
the implementation details (since the code is there for you to inspect)...

Cheers
Daniel

Thanks Chris and Daniel. It's looking more and more as if your
suggestions are winning me over. Finding something to something as
simple as changing a file's Last Write Time shouldn't be so elusive
and difficult, eh? It's such a snap in the normal .NET Framework :)

MsJ
 
Thanks Chris and Daniel. It's looking more and more as if your
suggestions are winning me over. Finding something to something as
simple as changing a file's Last Write Time shouldn't be so elusive
and difficult, eh? It's such a snap in the normal .NET Framework :)

MsJ


I'm looking at the simple call

FileEx.SetLastAccessTime(path, time);

in my code for the mean time after importing the OpenNETCF.IO
namespace. The OpenNetCF dll is 288 kB so I'm considering digging
deeper into the source code files to create a much, much smaller
library for just this specific function.

MsJ
 
I'm considering digging deeper into the source code
files to create a much, much smaller library for just
this specific function.
And that's the beauty of OpenNETCF initiative - if it's not exactly in the
form that you need, you're more than welcome to get the source and change it
as you see fit.
 
Back
Top