473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Managing files by Create time/date

I would like to use the timestamp on files to manage the
currency of support files for my VB windows application.
In this case I would only put the timestamp of the file
in the management database and not the file itself.

To do this I will need to have a File class property for
Create time and date that will let me "set" the Create
time and date of the file to my own chooseing.

The VB file class does not appear to have the ability
to "set" the Create time and date. It can only read it.

Is there another system class that will allow me to set
the Create Time and date of a file?
Nov 20 '05 #1
9 3206
> To do this I will need to have a File class property for
Create time and date that will let me "set" the Create
time and date of the file to my own chooseing.
The VB file class does not appear to have the ability
to "set" the Create time and date. It can only read it.


ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033

Try
Dim path As String = "c:\Temp\MyTest.txt"

If File.Exists(path) = False Then
File.Create(path)
Else
' Take an action that will affect the write time.
File.SetLastWriteTime(path, New DateTime(1985, 4, 3))
End If

' Get the creation time of a well-known directory.
Dim dt As DateTime = File.GetLastWriteTime(path)
Console.WriteLine("The last write time for this file was {0}.",
dt)

' Update the last write time.
File.SetLastWriteTime(path, DateTime.Now)
dt = File.GetLastWriteTime(path)
Console.WriteLine("The last write time for this file was {0}.",
dt)

Catch e As Exception
Console.WriteLine("The process failed: {0}", e.ToString())
End Try

Nov 20 '05 #2
How do I reconcile the fact that the user's computer
regional setting for date might be set to
31/2/1959 11:59:59 PM

But Access has the date stored as
2/31/1959 11:59:59 PM

Are they really the same standard format beneath the
covers??

I know this has got to be a old question...but it is a
first time for me.
Nov 20 '05 #3
> How do I reconcile the fact that the user's computer
regional setting for date might be set to
31/2/1959 11:59:59 PM

But Access has the date stored as
2/31/1959 11:59:59 PM

Are they really the same standard format beneath the
covers??


Hi Bob,

No that would not be the case.

What I do when working with SQL is get the time of the SQL Server it is
pulling info from in order to be indpependant of the users clock. In your
case I would find some outside source that you could access that will give
you a time (another server on the internet etc) to compare.
Nov 20 '05 #4
I believe you are looking for the FileInfo class:

http://msdn.microsoft.com/library/de...mberstopic.asp

--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
"Bob Achgill" <an*******@discussions.microsoft.com> wrote in message
news:17*****************************@phx.gbl...
I would like to use the timestamp on files to manage the
currency of support files for my VB windows application.
In this case I would only put the timestamp of the file
in the management database and not the file itself.

To do this I will need to have a File class property for
Create time and date that will let me "set" the Create
time and date of the file to my own chooseing.

The VB file class does not appear to have the ability
to "set" the Create time and date. It can only read it.

Is there another system class that will allow me to set
the Create Time and date of a file?

Nov 20 '05 #5
My question is about the order of the time/date pieces...

On one users computer he may have set his month to be
first and the day second

But in my Access data base I have the reversed...

so when I try to use the file info to check the Create
time or set the Create time I am apples and oranges
different between how the data base is talking time and
date and the Access data base is talking time and date.

Does it matter that the user has a different regional
setting for the order of time and date? Is that just
formatting as it appears to the eye of the user AND
beneath the covers the time and date appear the same
between the Access data base and the Windows operating
system??
-----Original Message-----
How do I reconcile the fact that the user's computer
regional setting for date might be set to
31/2/1959 11:59:59 PM

But Access has the date stored as
2/31/1959 11:59:59 PM

Are they really the same standard format beneath the
covers??
Hi Bob,

No that would not be the case.

What I do when working with SQL is get the time of the

SQL Server it ispulling info from in order to be indpependant of the users clock. In yourcase I would find some outside source that you could access that will giveyou a time (another server on the internet etc) to compare.

.

Nov 20 '05 #6
Bob,

Time formats do matter. If you have a different date formats you will need
to create code that can convert between any of the time formats used in your
update process. This conversion code will be used anywhere you need to
create, stamp, read, and compare dates coming from and going to different
formats.

Regional time differences must be considered. One approach to dealing with
time stamps accross time regions is to use coordinated universal time (UTC).
UTC can be used convert time on the server and time from a remote client to
UTC so you can make an apples to apples comparrison.

To update the user - are you pushing table rows to a table in a remote
user's copy of the Access database you have on the server? Or are you
pushing a new database (mdb) to them? If neither of these questions is true
what type of file are you keeping up on the remote client?

I ask because there are other approaches to keeping the remote client in
sync that do not involve working with a file's DateTime. I may be able to
provide directions for a simpler and more stable approach.
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Bob Achgill" <an*******@discussions.microsoft.com> wrote in message
news:17*****************************@phx.gbl...
My question is about the order of the time/date pieces...

On one users computer he may have set his month to be
first and the day second

But in my Access data base I have the reversed...

so when I try to use the file info to check the Create
time or set the Create time I am apples and oranges
different between how the data base is talking time and
date and the Access data base is talking time and date.

Does it matter that the user has a different regional
setting for the order of time and date? Is that just
formatting as it appears to the eye of the user AND
beneath the covers the time and date appear the same
between the Access data base and the Windows operating
system??
-----Original Message-----
How do I reconcile the fact that the user's computer
regional setting for date might be set to
31/2/1959 11:59:59 PM

But Access has the date stored as
2/31/1959 11:59:59 PM

Are they really the same standard format beneath the
covers??


Hi Bob,

No that would not be the case.

What I do when working with SQL is get the time of the

SQL Server it is
pulling info from in order to be indpependant of the

users clock. In your
case I would find some outside source that you could

access that will give
you a time (another server on the internet etc) to

compare.


.

Nov 20 '05 #7
Hi Mike,

Thank you for your advice.

We are making a free program that will run on Pentium 1
class computer with 16MB video card.

It will help illiterate people to learn to read their
native language.

The reading program is in VB .Net

As the student reads text in a WebBrowser window with in
the VB program it looks in the local database for each
word meaning and shows the associated Flash animation for
that word meaning to help the student understand the
meaning of the word. We also show an associated 3D
animation of the hand sign for that word meaning. We
pass this info from the VB .Net program to our C++
program that shows the hand sign.

Our users (in a 3rd world country) will probably
initially have someone hand them a CD that has the
starting programs+mdb+animation files for the language
they are working on learning to read. Let's say one
language will be about
1,800 - Flash animations ( 5 - 30 K each)
1,800 - 3D vector sign files (1-3K each)
mdb - with lexicon and pointers to Flash and sign
files (1MB)

As you can imagine such a system will have a lot of
updates as volunteers add or revise new animations and
hand signs. So we will give the capability to "phone
home" and receive updates if the user has internet
access.

We can use either use pulling rows from a server as an
option to do this and or FTP. The files could either be
packed in the rows and unpacked or straight FTP to the
client disk. If they are straight FTP then hence I need
to have Create Time stamps to determine version of the
files to be replaced on the client machine. If we go the
row transfer method for moving the files then I don't
need to rely on file time stamps.

Any advice on how to make this simpler is much
appreciated!

Bob
-----Original Message-----
Bob,

Time formats do matter. If you have a different date formats you will needto create code that can convert between any of the time formats used in yourupdate process. This conversion code will be used anywhere you need tocreate, stamp, read, and compare dates coming from and going to differentformats.

Regional time differences must be considered. One approach to dealing withtime stamps accross time regions is to use coordinated universal time (UTC).UTC can be used convert time on the server and time from a remote client toUTC so you can make an apples to apples comparrison.

To update the user - are you pushing table rows to a table in a remoteuser's copy of the Access database you have on the server? Or are youpushing a new database (mdb) to them? If neither of these questions is truewhat type of file are you keeping up on the remote client?
I ask because there are other approaches to keeping the remote client insync that do not involve working with a file's DateTime. I may be able toprovide directions for a simpler and more stable approach.

--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Bob Achgill" <an*******@discussions.microsoft.com> wrote in messagenews:17*****************************@phx.gbl...
My question is about the order of the time/date pieces...
On one users computer he may have set his month to be
first and the day second

But in my Access data base I have the reversed...

so when I try to use the file info to check the Create
time or set the Create time I am apples and oranges
different between how the data base is talking time and
date and the Access data base is talking time and date.

Does it matter that the user has a different regional
setting for the order of time and date? Is that just
formatting as it appears to the eye of the user AND
beneath the covers the time and date appear the same
between the Access data base and the Windows operating
system??
>-----Original Message-----
>> How do I reconcile the fact that the user's computer
>> regional setting for date might be set to
>> 31/2/1959 11:59:59 PM
>>
>> But Access has the date stored as
>> 2/31/1959 11:59:59 PM
>>
>> Are they really the same standard format beneath the
>> covers??
>
>Hi Bob,
>
>No that would not be the case.
>
>What I do when working with SQL is get the time of the

SQL Server it is
>pulling info from in order to be indpependant of the

users clock. In your
>case I would find some outside source that you could

access that will give
>you a time (another server on the internet etc) to

compare.
>
>
>.
>

.

Nov 20 '05 #8
Bob,

If you wish I am willing to donate some free time to help you work up the
best synchronization approach for this project.

By taking the time to explain the project in your latest email, you have
given me enough to see at least four ways to accomplish synchronization, all
of which I have implemented in real-world projects.

If you would like to take advantage of my offer please contact me at
mi****@getdotnetcode.com. Ideally we could talk on the phone for 15-30
minutes and nail down enough specifics for me to prepare a written
recommendation and some example code.

If you do not want to go in this direction I will answer your latest post
directly here in the newsgroup.

Regards,
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Bob Achgill" <an*******@discussions.microsoft.com> wrote in message
news:17*****************************@phx.gbl...
Hi Mike,

Thank you for your advice.

We are making a free program that will run on Pentium 1
class computer with 16MB video card.

It will help illiterate people to learn to read their
native language.

The reading program is in VB .Net

As the student reads text in a WebBrowser window with in
the VB program it looks in the local database for each
word meaning and shows the associated Flash animation for
that word meaning to help the student understand the
meaning of the word. We also show an associated 3D
animation of the hand sign for that word meaning. We
pass this info from the VB .Net program to our C++
program that shows the hand sign.

Our users (in a 3rd world country) will probably
initially have someone hand them a CD that has the
starting programs+mdb+animation files for the language
they are working on learning to read. Let's say one
language will be about
1,800 - Flash animations ( 5 - 30 K each)
1,800 - 3D vector sign files (1-3K each)
mdb - with lexicon and pointers to Flash and sign
files (1MB)

As you can imagine such a system will have a lot of
updates as volunteers add or revise new animations and
hand signs. So we will give the capability to "phone
home" and receive updates if the user has internet
access.

We can use either use pulling rows from a server as an
option to do this and or FTP. The files could either be
packed in the rows and unpacked or straight FTP to the
client disk. If they are straight FTP then hence I need
to have Create Time stamps to determine version of the
files to be replaced on the client machine. If we go the
row transfer method for moving the files then I don't
need to rely on file time stamps.

Any advice on how to make this simpler is much
appreciated!

Bob
-----Original Message-----
Bob,

Time formats do matter. If you have a different date

formats you will need
to create code that can convert between any of the time

formats used in your
update process. This conversion code will be used

anywhere you need to
create, stamp, read, and compare dates coming from and

going to different
formats.

Regional time differences must be considered. One

approach to dealing with
time stamps accross time regions is to use coordinated

universal time (UTC).
UTC can be used convert time on the server and time from

a remote client to
UTC so you can make an apples to apples comparrison.

To update the user - are you pushing table rows to a

table in a remote
user's copy of the Access database you have on the

server? Or are you
pushing a new database (mdb) to them? If neither of

these questions is true
what type of file are you keeping up on the remote

client?

I ask because there are other approaches to keeping the

remote client in
sync that do not involve working with a file's DateTime.

I may be able to
provide directions for a simpler and more stable

approach.


--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Bob Achgill" <an*******@discussions.microsoft.com>

wrote in message
news:17*****************************@phx.gbl...
My question is about the order of the time/date pieces...
On one users computer he may have set his month to be
first and the day second

But in my Access data base I have the reversed...

so when I try to use the file info to check the Create
time or set the Create time I am apples and oranges
different between how the data base is talking time and
date and the Access data base is talking time and date.

Does it matter that the user has a different regional
setting for the order of time and date? Is that just
formatting as it appears to the eye of the user AND
beneath the covers the time and date appear the same
between the Access data base and the Windows operating
system??

>-----Original Message-----
>> How do I reconcile the fact that the user's computer
>> regional setting for date might be set to
>> 31/2/1959 11:59:59 PM
>>
>> But Access has the date stored as
>> 2/31/1959 11:59:59 PM
>>
>> Are they really the same standard format beneath the
>> covers??
>
>Hi Bob,
>
>No that would not be the case.
>
>What I do when working with SQL is get the time of the
SQL Server it is
>pulling info from in order to be indpependant of the
users clock. In your
>case I would find some outside source that you could
access that will give
>you a time (another server on the internet etc) to
compare.
>
>
>.
>

.

Nov 20 '05 #9
Thank you.

I will write you.

Bob
-----Original Message-----
Bob,

If you wish I am willing to donate some free time to help you work up thebest synchronization approach for this project.

By taking the time to explain the project in your latest email, you havegiven me enough to see at least four ways to accomplish synchronization, allof which I have implemented in real-world projects.

If you would like to take advantage of my offer please contact me atmi****@getdotnetcode.com. Ideally we could talk on the phone for 15-30minutes and nail down enough specifics for me to prepare a writtenrecommendation and some example code.

If you do not want to go in this direction I will answer your latest postdirectly here in the newsgroup.

Regards,
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eliezer Figueroa | last post by:
Managing Multiple Excel incoming files? I have this situation. I have a client which have several locations they work primary with excel forms and they are thinking in doing reports with them....
21
by: dub | last post by:
Hello web folks... I've been desigining web pages for 13 years using my trusty text editor (UltraEdit) and in depth knowledge of HTML. I'm truly a text editor ninja at this point. I am frequently...
7
by: tgh003 | last post by:
I would be interested to hear how others are managing their javascript (.js) files from the original code vs the obfuscated version they publish to their site/webapp. I currently manage 2 files,...
9
by: John J. Hughes II | last post by:
Is it possible using Image or Bitmap to build and save an animated GIF file? I am not have a problem saving the GIF file just getting the frames added to it. I did find ImageAnimator but it only...
9
by: Chris Pearl | last post by:
Are there Python tools to help webmasters manage static websites? I'm talking about regenerating an entire static website - all the HTML files in their appropriate directories and...
1
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
0
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
4
by: jonathan184 | last post by:
Hi I have a perl script, basically what it is suppose to do is check a folder with files. Now the files are checked using a timestamp with the command ls -l so the timestamp in this format is...
1
by: Madhu Harchandani | last post by:
Hello i am working in a project in which i am using xnat technology in that data is entered through xml files only i need to enter 1000 records .so it is very cumbersome to create...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.