WilliamasKumeliukas Posted July 22, 2014 Share Posted July 22, 2014 (edited) *UPDATED* Hi, I need some help with my script that verify my backup sizes and date. like my codes show below, I want it to get the subfolders name and return it as Arrays then I use the result of the subfolder as the current full path because everyday the subfolder name is changed. when i'm trying to retrieve the date and time of the specific file inside this subfolder, it return me that subscript error. I don't get what I am doing wrong in those lines... ;################################## ; Variables ;################################## $amaster = _FileListToArray("E:BKPESX1master.attisee.local","*",2,True) $ap99 = _FileListToArray("E:BKPESX1P99","*",2,True) $asrv = _FileListToArray("E:BKPESX1SRV","*",2,True) $ats = _FileListToArray("E:BKPESX1TS","*",2,True) $time = " / Date du backup: " $dmaster = FileGetTime($amaster & "master.attisee.local-flat.vmdk",0) $dp99 = FileGetTime($ap99 & "Comptabilite-flat.vmdk",0) $dsrv = FileGetTime($asrv & "SRV-flat.vmdk",0) $dts = FileGetTime($ats & "TS-flat.vmdk",0) $tmaster = $dmaster[0] & "-" & $dmaster[1] & "-" & $dmaster[2] & " " & $dmaster[3] & "hour " & $dmaster[4] & "min " & $dmaster[5] & "sec" ==> Subscript used on non-accessible variable. : $tp99 = $dp99[0] & "-" & $dp99[1] & "-" & $dp99[2] & '-' & $dp99[3] & "h " & $dp99[4] & "min " & $dp99[5] & "sec" $tsrv = $dsrv[0] & "-" & $dsrv[1] & "-" & $dsrv[2] & '-' & $dsrv[3] & "h " & $dsrv[4] & "min " & $dsrv[5] & "sec" $tts = $dts[0]& "-" & $dts[1] & "-" & $dts[2]&'-'&$dts[3]& "h " & $dts[4] & "min " & $dts[5] & "sec" if possible it would be great to explain in simplified way, I'm still new to the language. Regards Edited July 22, 2014 by AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 22, 2014 Share Posted July 22, 2014 (edited) It would also be great to say what actual problem you're having, so others can help you. At the moment, if the Help file can't help, nobody else can either.. Edited July 22, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 (edited) sorry somdcomputerguy, you been too quick , I was still editing my first post because of a mistake. its updated now Edited July 22, 2014 by AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 22, 2014 Share Posted July 22, 2014 (edited) No problem. I'm never too slow or too fast, I was just kinda half fast there.. The first problem I can see is that you are passing a variable to FileGetTime that should be an array, since that variable was gotten from FileListToArray. If "master.attisee.local-flat.vmdk" is actually a number, try a line like this (the same for the other incorrect lines) - $dmaster = FileGetTime($amaster[ & "master.attisee.local-flat.vmdk" & ] ,0). I haveven't tested this is any way myself, so this syntax might not be correct, you might have to juggle it around a bit.. Edited July 22, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
November Posted July 22, 2014 Share Posted July 22, 2014 Hi there, You can try do _Arraydisplay all arrays. Probably some array maybe isn´t an array after all. Once i had some problems getting time of the files. i hope it helps. Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 22, 2014 Share Posted July 22, 2014 You can try do _Arraydisplay all arrays. That's a good idea. I'm not 100% on arrays (a whole lot better than with RegEx though..), and I tend to use that function just to see what I have to work with.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 No problem. I'm never too slow or too fast, I was just kinda half fast there.. The first problem I can see is that you are passing a variable to FileGetTime that should be an array, since that variable was gotten from FileListToArray. If "master.attisee.local-flat.vmdk" is actually a number, try a line like this (the same for the other incorrect lines) - $dmaster = FileGetTime($amaster[ & "master.attisee.local-flat.vmdk" & ] ,0). I haveven't tested this is any way myself, so this syntax might not be correct, you might have to juggle it around a bit.. actually "master.attisee.local-flat.vmdk" is the filename inside the subfolder that I'm searching with FileListToArray so I want it to return the fullpath with the CURRENT name of the subfolder in "E:BKPESX1master.attisee.local" Example: if I run the script today, it must get this path ("E:BKPESX1master.attisee.localmaster.attisee.local-2014-07-21_22-00-03") into a variable used in FileGetTime($amaster & "master.attisee.local-flat.vmdk") Tomorow it will be another folder name like this: (E:BKPESX1master.attisee.localmaster.attisee.local-2014-07-22_*time of the file was created*") I need it to go in the folder no matter what is the name of that folder. ( I'll try right now: $dmaster = FileGetTime($amaster[ & "master.attisee.local-flat.vmdk" & ] ,0) ) Thanks for replies and help Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 $dmaster = FileGetTime($amaster[ & "master.attisee.local-flat.vmdk" & ] ,0) = Syntax error Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
November Posted July 22, 2014 Share Posted July 22, 2014 $dmaster = FileGetTime($amaster[ & "master.attisee.local-flat.vmdk" & ] ,0) = Syntax error Try like this : $dmaster = FileGetTime($amaster & "\master.attisee.local-flat.vmdk",0) Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 $tmaster = $dmaster[0] & "-" & $dmaster[1] & "-" & $dmaster[2] & " " & $dmaster[3] & "hour " & $dmaster[4] & "min " & $dmaster[5] & "sec" ==> Subscript used on non-accessible variable.: Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
November Posted July 22, 2014 Share Posted July 22, 2014 I believe that $dmaster is not an array, better yet, it is a empty array. Try to use _Arraydisplay ($dmaster, "test") before. Don't forget to include array.au3 in the beginning of your script. Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 here is a screenshot of what it looks like in scite... Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
November Posted July 22, 2014 Share Posted July 22, 2014 Use this line before calling $tmaster. _Arraydisplay ($dmaster, "test") Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 (edited) still subscript used on non-accessible variable.. I also noticed that it does this error to: $tmaster $tp99 $tsrv $tts Edited July 22, 2014 by AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
November Posted July 22, 2014 Share Posted July 22, 2014 Ok... but what the _Arraydisplay says? can you see all the array subscriptions? Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 (edited) no, it popup Autoit Error msgbox with error description as: Subscript used on non-accessible variable.: Edited July 22, 2014 by AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
November Posted July 22, 2014 Share Posted July 22, 2014 Is that file path included as a variable? Care to share the script? Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 Is that file path included as a variable? Care to share the script? Cheers actually "master.attisee.local-flat.vmdk" is the filename inside the subfolder that I'm searching with FileListToArray so I want it to return the fullpath with the CURRENT name of the subfolder in "E:BKPESX1master.attisee.local" Example: if I run the script today, it must get this path ("E:BKPESX1master.attisee.localmaster.attisee.local-2014-07-21_22-00-03") into a variable used in FileGetTime($amaster & "master.attisee.local-flat.vmdk") Tomorow it will be another folder name like this: (E:BKPESX1master.attisee.localmaster.attisee.local-2014-07-22_*time of the file was created*") Like I said, FileListToArray is suposed to retrieve the subfolder name and return it as a variable thats I'm using into FileGetTime($variable & "FullFileName") Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 22, 2014 Share Posted July 22, 2014 ( I'll try right now: $dmaster = FileGetTime($amaster[ & "master.attisee.local-flat.vmdk" & ] ,0) ) That won't work, and obviously it already hasn't, because $amaster and the other variables you define with the _FileListToArray function are arrays. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 (edited) That won't work, and obviously it already hasn't, because $amaster and the other variables you define with the _FileListToArray function are arrays. Ok thanks ill suspend this until I can get this FileGetTime working without errors Here is the script code for test purposes: test it with your own target file. #Include <file.au3> #include <date.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> ;################################## ; Variables ;################################## $amaster = "E:\BKP\ESX1\master.attisee.local" $dmaster = FileGetTime($amaster & "\master.attisee.local-flat.vmdk",0) $tmaster = $dmaster[0] & "-" & $dmaster[1] & "-" & $dmaster[2] & " " & $dmaster[3] & "hour " & $dmaster[4] & "min " & $dmaster[5] & "sec" $master = FileGetSize($amaster & "\master.attisee.local-flat.vmdk") MsgBox(0,"test",$master & $tmaster) Edited July 22, 2014 by AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now