Saving over existing files doesn't change the modified date
- marcoagpinto
- Addict
- Posts: 947
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Saving over existing files doesn't change the modified date
Hello!
When I save over existing files, such as PNGs (images?) and others, it doesn't change the modified date in the files properties on the HDD.
When I save over existing files, such as PNGs (images?) and others, it doesn't change the modified date in the files properties on the HDD.
Last edited by marcoagpinto on Fri Mar 24, 2017 11:53 am, edited 1 time in total.
Re: Saving over existing files doesn't change the modified d
More than likely you are not saving the file where you think it should go. ( windows temp path or APP path )
look at your filepath or filename before saving file:
Norm.
look at your filepath or filename before saving file:
Code: Select all
debug fliepath$
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
- marcoagpinto
- Addict
- Posts: 947
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Saving over existing files doesn't change the modified d
Well, I open a file selector from my code and choose the files.normeus wrote:More than likely you are not saving the file where you think it should go. ( windows temp path or APP path )
look at your filepath or filename before saving file:Norm.Code: Select all
debug fliepath$
Then, when I write over existing ones, the "modified" is still months ago when I saved them for the first time.
Re: Saving over existing files doesn't change the modified d
Please always post a code snippet showing the issue, thank you.
Re: Saving over existing files doesn't change the modified d
I think, you are saved in virtualstore?
If so, you have to write with adminright or you change the path, in a none secure location.
If so, you have to write with adminright or you change the path, in a none secure location.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
- marcoagpinto
- Addict
- Posts: 947
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Saving over existing files doesn't change the modified d
Freddy, my brother, sorry.Fred wrote:Please always post a code snippet showing the issue, thank you.
Here is the snippet.
If you save a file and then save again over it, the modified file properties in the HDD are always the first one it was saved:
Code: Select all
#WINDOW_MAIN=1
#WINDOW_MAIN_CANVAS=2
#SCREEN_BUFFER=3
UsePNGImageDecoder()
UsePNGImageEncoder()
OpenWindow(#WINDOW_MAIN,0,0,640,480,"Saving file bug in modified properties")
CanvasGadget(#WINDOW_MAIN_CANVAS,10,10,250,250)
file$=SaveFileRequester("Save background image", "", "Images (.png)|*.png", 0)
If file$<>""
; Add extension if none is written (".png")
If LCase(Right(file$,4))<>".png" : file$+".png" : EndIf
; Grab image
CreateImage(#SCREEN_BUFFER, 250, 250)
StartDrawing(ImageOutput(#SCREEN_BUFFER))
DrawImage(GetGadgetAttribute(#WINDOW_MAIN_CANVAS,#PB_Canvas_Image),0,0)
StopDrawing()
; Save image
If SaveImage(#SCREEN_BUFFER,file$,#PB_ImagePlugin_PNG)=#False
MessageRequester("Error", "Can't save background image.")
EndIf
EndIf
Re: Saving over existing files doesn't change the modified d
On Win10 is all at normal state. Modified date is always changed if I overwrite it.
You have to update the explorer view before you get the properties from the contextmenu ...
Sometimes the explorer didn't update it by himself... so a manually update must be made.
You have to update the explorer view before you get the properties from the contextmenu ...
Sometimes the explorer didn't update it by himself... so a manually update must be made.
Re: Saving over existing files doesn't change the modified d
No issue here with the snippet. The re-saving of the png image causes every-time the update to the file modified date.
ts-soft might be right? I wonder if your changes are being done in %LOCALAPPDATA%\VirtualStore
ts-soft might be right? I wonder if your changes are being done in %LOCALAPPDATA%\VirtualStore
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
- marcoagpinto
- Addict
- Posts: 947
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Saving over existing files doesn't change the modified d
Buaaaaaa... what is a virtual store?
I simply save the files in the HDD.
What is wrong with saving files in the HDD?
Shouldn't the properties be updated automatically?
I am using Windows 10.
I simply save the files in the HDD.
What is wrong with saving files in the HDD?
Shouldn't the properties be updated automatically?
I am using Windows 10.
Re: Saving over existing files doesn't change the modified d
If you have the file properties dialog up, and you do overwrite. The file properties dialog information won't automatically update. You have to close and re-visit the file properties to have the updated information.
However even w/Windows 10, you overwrite the modified date information is updated correctly. You just re-visit this file properties again and compare.
Regarding VirtualStore, http://en.wikipedia.org/wiki/User_Accou ... l#Features
However even w/Windows 10, you overwrite the modified date information is updated correctly. You just re-visit this file properties again and compare.
Regarding VirtualStore, http://en.wikipedia.org/wiki/User_Accou ... l#Features
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Re: Saving over existing files doesn't change the modified d
You could also use the following to verify this;
Code: Select all
#WINDOW_MAIN=1
#WINDOW_MAIN_CANVAS=2
#SCREEN_BUFFER=3
UsePNGImageDecoder()
UsePNGImageEncoder()
Procedure.s Main()
Static file$
OpenWindow(#WINDOW_MAIN,0,0,640,480,"Saving file bug in modified properties")
CanvasGadget(#WINDOW_MAIN_CANVAS,10,10,250,250)
If file$ = ""
file$=SaveFileRequester("Save background image", "", "Images (.png)|*.png", 0)
EndIf
If file$<>""
; Add extension if none is written (".png")
If LCase(Right(file$,4))<>".png" : file$+".png" : EndIf
; Grab image
CreateImage(#SCREEN_BUFFER, 250, 250)
StartDrawing(ImageOutput(#SCREEN_BUFFER))
DrawImage(GetGadgetAttribute(#WINDOW_MAIN_CANVAS,#PB_Canvas_Image),0,0)
StopDrawing()
; Save image
If SaveImage(#SCREEN_BUFFER,file$,#PB_ImagePlugin_PNG)=#False
MessageRequester("Error", "Can't save background image.")
EndIf
ProcedureReturn file$
EndIf
EndProcedure
File$ = Main()
If File$
Debug File$
Mod1 = GetFileDate(File$, #PB_Date_Modified)
Debug " Modified: "+Mod1+" ("+FormatDate("%hh:%ii:%ss", Mod1)+")"
Delay(1000)
File$ = Main()
If File$
Debug File$
Mod2 = GetFileDate(File$, #PB_Date_Modified)
Debug " Modified: "+Mod2+" ("+FormatDate("%hh:%ii:%ss", Mod2)+")"
If Mod1 <> Mod2
Debug #CRLF$+"Files are with different MODIFIED dates."
EndIf
EndIf
EndIf
Code: Select all
D:\Users\Thor\Documents\11111.png
Modified: 1490486310 (23:58:30)
D:\Users\Thor\Documents\11111.png
Modified: 1490486311 (23:58:31)
Files are with different MODIFIED dates.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley