Write to file without changin Date modified
Write to file without changin Date modified
Hi i use:
http://www.newlisp.org/downloads/newlis ... write-file
To uppdate textfiles, but i don't want the "Date modified" uppdated.
Can I do that in some way?
http://www.newlisp.org/downloads/newlis ... write-file
To uppdate textfiles, but i don't want the "Date modified" uppdated.
Can I do that in some way?
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
No, there isn't. However Lutz' coding of file-info for retrieving the data might show the way to set the data.cormullion wrote: Presumably there's a 'touch' command on Windows...
...it is better to first strive for clarity and correctness and to make programs efficient only if really needed.
"Getting Started with Erlang" version 5.6.2
"Getting Started with Erlang" version 5.6.2
Windows doesn't come with 'touch'--- but it is widely available on the net. I've never thought about it since I've always had it in my toolkit as a developer. It is trivial to write. Seems to me that in the long ago days one came with the Borland dev kits. Not having it is sort of like not having grep ;)
--hsm
--hsm
"Censeo Toto nos in Kansa esse decisse."—D. Gale "ℑ♥λ"—Toto
Hi and thanx for you replys.
So what you say is that one solution is to, get a touch for Windows and then read the "Date modified" value, uppdate the file and then set back the value afterwards.
Will maybe try fixing that.
edit: Maybe I can use the version of touch from: http://gnuwin32.sourceforge.net/packages/coreutils.htm
So what you say is that one solution is to, get a touch for Windows and then read the "Date modified" value, uppdate the file and then set back the value afterwards.
Will maybe try fixing that.
edit: Maybe I can use the version of touch from: http://gnuwin32.sourceforge.net/packages/coreutils.htm
aron,
Actually I'd do both--- first acquire a working 'touch'. The one you point to is a good one, as are the rest of their Unix tools; get them all, you will need them sooner or later. Second, see if newLISP can solve your problem by trying the other suggestions made here. It will teach you more about both newLISP and the file system. Both worth knowing.
--hsm
Actually I'd do both--- first acquire a working 'touch'. The one you point to is a good one, as are the rest of their Unix tools; get them all, you will need them sooner or later. Second, see if newLISP can solve your problem by trying the other suggestions made here. It will teach you more about both newLISP and the file system. Both worth knowing.
--hsm
"Censeo Toto nos in Kansa esse decisse."—D. Gale "ℑ♥λ"—Toto
If your target is Windows, you could also wield the win32api directly through (import).
Here is a page showing what win32api functions do what (written in Visual Basic).
http://vbnet.mvps.org/code/fileapi/filedatetime.htm
Here is a page showing what win32api functions do what (written in Visual Basic).
http://vbnet.mvps.org/code/fileapi/filedatetime.htm
While I suppose you could go through the Win32 API, here is all you really need:
INT 21 Function 5701h:SET FILE'S LAST-WRITTEN DATE AND TIME
AX = 5701h
BX = file handle
CX = new time
DX = new date
Return:
CF clear if successful CF set on error AX = error code (01h,06h)
Bitfields for file time:
Bit(s) Description
15-11 hours (0-23)
10-5 minutes
4-0 seconds/2
Bitfields for file date:
Bit(s) Description
15-9 year - 1980
8-5 month
4-0 day
1. write dll in assembler
2. write glue in newLISP
3. use
--hsm
p.s. note that this function is handle based, so you will have to open the file you want to touch. Probably could get away without closing, but to be safe, call the close function as well.
INT 21 Function 5701h:SET FILE'S LAST-WRITTEN DATE AND TIME
AX = 5701h
BX = file handle
CX = new time
DX = new date
Return:
CF clear if successful CF set on error AX = error code (01h,06h)
Bitfields for file time:
Bit(s) Description
15-11 hours (0-23)
10-5 minutes
4-0 seconds/2
Bitfields for file date:
Bit(s) Description
15-9 year - 1980
8-5 month
4-0 day
1. write dll in assembler
2. write glue in newLISP
3. use
--hsm
p.s. note that this function is handle based, so you will have to open the file you want to touch. Probably could get away without closing, but to be safe, call the close function as well.
"Censeo Toto nos in Kansa esse decisse."—D. Gale "ℑ♥λ"—Toto
Yes, the interrupts still work, but it is frowned upon to use them. MS claims they may not be reliable anymore.m35 wrote:You can still do that? O_Ohsmyers wrote:INT 21 Function
...it is better to first strive for clarity and correctness and to make programs efficient only if really needed.
"Getting Started with Erlang" version 5.6.2
"Getting Started with Erlang" version 5.6.2