How to retrieve file's modified datetime from TFileStream or AnsiString

Hi all,

I'm facing the following problem : The binary contents of a file are stored in a AnsiString (not my choice) and I would like to retrieve the datetime when the file was last modified. 

Is there a way of doing this or does this datetime only exist when the file is on disk and has a descriptor managed by the operating system ?

The said file has been actually uploaded to a webserver with a Delphi ISAPI dll.

Thanks !
-1
Alex
7/15/2010 1:26:16 PM
embarcadero.delphi.non-tech 5933 articles. 1 followers. Follow

3 Replies
699 Views

Similar Articles

[PageSpeed] 35

<Alex Istra> wrote in message news:261086@forums.embarcadero.com...
>
> or does this datetime only exist when the file is on disk and has a 
> descriptor managed by the operating system ?

yes.
-1
Uffe
7/15/2010 1:55:50 PM
<Alex Istra> wrote in message news:261086@forums.embarcadero.com...

> I'm facing the following problem : The binary contents of a
> file are stored in a AnsiString (not my choice) and I would
> like to retrieve the datetime when the file was last modified.

If you have a local file opened via CreateFile(), FileOpen(), or 
TFileStream, then you can use GetFileTime() to get the current timestamps of 
the file.

> does this datetime only exist when the file is on disk and has
> a descriptor managed by the operating system ?

Yes.  If you have data loaded in memory instead, and are making changes to 
the contents of that memory, then you have to keep track of your own 
timestamp.

> The said file has been actually uploaded to a webserver
> with a Delphi ISAPI dll.

Are you downloading a remote file into local memory?  If so, then you will 
have to ask the webserver what the current timestamp of the remote file is 
via an HTTP HEAD request.

-- 
Remy Lebeau (TeamB)
-1
Remy
7/15/2010 6:22:42 PM
Thanks ! yep I figured the only way to keep the timestamp is to retrieve it from the HTTP headers at the time of upload and store it along with the binary data of the file ...
-1
Alex
7/19/2010 11:22:28 AM
Reply:

Similar Artilces:

here's a tech question for non-tech
I have not had occasion to want to do this before, so I'm hoping someone can enlighten me. I have an app built in D7, and it's rather complex in its functionality. Is it possible to rebuild the app to run as a service? Would that require separating the user interface from the app? Thanks, Bill William Meyer wrote on 4/22/2010 : > I have not had occasion to want to do this before, so I'm hoping > someone can enlighten me. I have an app built in D7, and it's rather > complex in its functionality. Is it possible to rebuild the app to run > as a service?...

[ID 20000127.003] File-scope 'my' array is non-empty, but debugger says it's empty
This is a bug report for perl from rmiller@idx.com, generated with the help of perlbug 1.26 running under perl 5.00503. ----------------------------------------------------------------- [Please enter your report here] The following two-line file illustrates the problem: my @res = ("A\n"); print @res; Running this with "perl -w" or "perl -w -d" produces the expected output (a line containing the single letter 'A'). But in the perl debugger, the command x @res given after the first line executes, but before the second start, ...

superreview requested: [Bug 361730] Seamonkey _deletes_ mail file if the mail file's size is greater than 2GiB and the .msf file has zero length : [Attachment 246709] biesi's proposal
David Bienvenu <bienvenu@nventure.com> has asked Scott MacGregor <mscott@mozilla.org> for superreview: Bug 361730: Seamonkey _deletes_ mail file if the mail file's size is greater than 2GiB and the .msf file has zero length https://bugzilla.mozilla.org/show_bug.cgi?id=361730 Attachment 246709: biesi's proposal https://bugzilla.mozilla.org/attachment.cgi?id=246709&action=edit ...

superreview granted: [Bug 361730] Seamonkey _deletes_ mail file if the mail file's size is greater than 2GiB and the .msf file has zero length : [Attachment 246709] biesi's proposal
Scott MacGregor <mscott@mozilla.org> has granted David Bienvenu <bienvenu@nventure.com>'s request for superreview: Bug 361730: Seamonkey _deletes_ mail file if the mail file's size is greater than 2GiB and the .msf file has zero length https://bugzilla.mozilla.org/show_bug.cgi?id=361730 Attachment 246709: biesi's proposal https://bugzilla.mozilla.org/attachment.cgi?id=246709&action=edit ...

Open file in browser or application getting the page's name as the file's name
Hi, I'm am trying to get a file to open in either a browser or application depending on the mime type. I'am using the following code in the page load. protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack)    { DocumentInfo document = (DocumentInfo)Session["View_Document"]; StreamFile(document.Document, document.DocumentName, document.FileType.MimeType); } } }private void StreamFile(byte[] fileData, string originalFileName, string mimeType) { try { Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("Con...

How store ultralite10's database file(.udb file) in wince emulator's store card?
i use ultralite10(develop version) in vs2005 with wm5.0 emulator. i find i can't store .udb file in emulatotr store card.it will make a "SQLE_MEMORY_ERROR", why happened this? what should i do so i can may the .udb file in emulator's store card? We haven't had any issues with this. You can post more details about how you attempted to connect or open a tech support case Mike > We haven't had any issues with this. You can post more > details about how you attempted to connect or open a tech > support case > > Mike > > t...

ORDER BY [Date] isn't working since it's not a DateTime (it's a varchar!)
Hi everyone. I know, I know, it should have been a datetime from the start...but here's the problem. I'm trying to sort by my date field but because it looks like: "04/03/2004 12:14:21 PM" it's not ordering it properly using: ORDER BY [Date] Are there any work arounds for this? Is there some way of doing: ORDER BY covert(datetime, [Date], 103) or something? Cheers Andrewwww.codingmayhem.com - VB.NET, C#, Silverlight, Javascript, HTML, CSS, T-SQL, MySQL and SQLitewww.headshotgamer.com - Gaming News and Reviews SELECT Convert(datetime, [Date], 103), Columnnames...

Python's 'DateTime'
Date/Time type announcement http://www.python.org/doc/2.3/whatsnew/node18.html#SECTION0001810000000000000000 'DateTime' Object http://www.python.org/doc/2.3/lib/module-datetime.html Gregorian Calendar from Calendrical Calculations that requires 'DateTime' http://www.python.org/doc/2.3/lib/module-calendar.html 'Duration' Object http://www.python.org/doc/2.3/lib/datetime-timedelta.html 'TimeZone' Object (complete with the EST timezone) http://www.python.org/doc/2.3/lib/datetime-tzinfo.html 'Incomplete' Date/Time Object http://www.pytho...

What's witht the .exe's when dling a file
I was downloading a debial iso to a directory in my E: drive. In the middle of it I got a popup saying that my C: drive was filled and that there wasn't room for an [somerandomlookingstring].exe there. Why is moz creating an exe for a download? -- Mark Heaely marknews(at)healeyonline(dot)com On 03/10/27 22:50 Mark Healey apparently typed: > I was downloading a debial iso to a directory in my E: drive. In > the middle of it I got a popup saying that my C: drive was filled and > that there wasn't room for an [somerandomlookingstring].exe there. Unless your ...

Replace 1's and 0's in a gridview column with Yes's and No's
Is it possible to change the display of a column in a gridview to show a Yes for all 1's and a No for 0's that display in a particular column of a gridview bound to a database?  If so, can someone share the way with me?  I am using ASP.NET 2.0 with VB Code Behind.  Thanks One way you can do is thrrough  CASE in your select statement: Select YesNoColumn= CASE yourColumn WHEN 1 THEN 'Yes' WHEN 0 THEN 'No' ELSE '' END FROM YourtableLimno <Columns>     <asp:TemplateField HeaderText="yourHeader" SortExpression="yourDataField"> ...

It's Linux !? No, it's BSD ! No, no, it's...
kFreeBSD http://wiki.debian.org/Debian_GNU/kFreeBSD a Debian distro using the FreeBSD kernel ! ObiWan wrote: > kFreeBSD > > http://wiki.debian.org/Debian_GNU/kFreeBSD > > a Debian distro using the FreeBSD kernel ! Why use a BSD kernel? I hope the reason is more than, just because they can. http://wiki.debian.org/Debian_GNU/kFreeBSD_why It's easy to understand why the would want to use Debian packages. :) -- Jimmy Johnson Registered Linux User #380263 >> kFreeBSD >> >> http://wiki.debian.org/Debian_GNU/kFreeBSD >> ...

Needed List of RunTime File's / DLL's.
Can someone give me the list of needed Runtime File's / DLL's needed for PB7 applications. Thanks. Refer to the following Sybase info: <http://www.sybase.com/content/1001114/deploymentinfo.pdf> //Martin "DJD" <djd@str.org> wrote in message news:#6Ke$1CeBHA.346@forums.sybase.com... > Can someone give me the list of needed Runtime File's / DLL's needed for PB7 > applications. > > Thanks. > > Go here, it lists them all: http://manuals.sybase.com/onlinebooks/group-pb/pbg0702e/apptech/@Generic__BookView Acco...

superreview denied: [Bug 275960] document.lastModified cannot handle non-ascii characters when the page's HTTP header doesn't have Last-Modified : [Attachment 189908] Patch rv1.0
Boris Zbarsky <bzbarsky@mit.edu> has denied Masayuki Nakano (Mozilla Japan) <masayuki@d-toybox.com>'s request for superreview: Bug 275960: document.lastModified cannot handle non-ascii characters when the page's HTTP header doesn't have Last-Modified https://bugzilla.mozilla.org/show_bug.cgi?id=275960 Attachment 189908: Patch rv1.0 https://bugzilla.mozilla.org/attachment.cgi?id=189908&action=edit ------- Additional Comments from Boris Zbarsky <bzbarsky@mit.edu> This doesn't seem like the right fix, since in general there is no reason this stri...

superreview granted: [Bug 275960] document.lastModified cannot handle non-ascii characters when the page's HTTP header doesn't have Last-Modified : [Attachment 190024] Patch rv3.0
Boris Zbarsky <bzbarsky@mit.edu> has granted Masayuki Nakano (Mozilla Japan) <masayuki@d-toybox.com>'s request for superreview: Bug 275960: document.lastModified cannot handle non-ascii characters when the page's HTTP header doesn't have Last-Modified https://bugzilla.mozilla.org/show_bug.cgi?id=275960 Attachment 190024: Patch rv3.0 https://bugzilla.mozilla.org/attachment.cgi?id=190024&action=edit ...

Web resources about - How to retrieve file's modified datetime from TFileStream or AnsiString - embarcadero.delphi.non-tech

1.76复古传奇玩家交流-1.76复古传奇_新开传奇私服_网通传奇私服-xiao114传奇私服发布网
xiao114,1.76复古传奇,发布网提供最全的1.76复古传奇玩家交流信息。

Resources last updated: 12/16/2015 12:27:04 PM