|
Post by DARKNIGHT on Feb 24, 2024 4:17:01 GMT -5
Hey Guys, I am working on a new program and was wondering is there a way of accessing the Meta Data of when a file was created in a directory?
Thanks ahead of time
|
|
|
Post by tsh73 on Feb 24, 2024 5:37:38 GMT -5
|
|
|
Post by Rod on Feb 24, 2024 9:16:28 GMT -5
If you truly mean meta data you need to read in the header or footer and knowing the Tag names search for the data in the header or footer. This code searches for title album and band in mp3 files. Just an example, shows how true meta data is a bit harder to extract.
dim music$(5000) musicnum=1 dim info$(0,0) dim albumlist$(0,0) dim titlelist$(0,0) songpath$=DefaultDir$ files songpath$, albumlist$() maxfiles=val(albumlist$(0,0)) maxalbum=val(albumlist$(0,1)) for n=1 to maxalbum print albumlist$(maxfiles+n,1) files songpath$+"\"+albumlist$(maxfiles+n,1),"*.mp3", titlelist$() maxtitle=val(titlelist$(0,0)) for m=1 to maxtitle filepath$=songpath$+"\"+albumlist$(maxfiles+n,1)+"\"+titlelist$(m,0) open filepath$ for binary as #title s$=input$(#title,1028) t=instr(s$,"TIT2") a=instr(s$,"TALB") p=instr(s$,"TPE1") if p>0 then l=asc(mid$(s$,p+7,1))+asc(mid$(s$,p+6,1))*256+asc(mid$(s$,p+5,1))*65536+asc(mid$(s$,p+4,1))*16777216 perfo$=mid$(s$,p+11,l-1) else perfo$="Unknown" end if if t>0 then l=asc(mid$(s$,t+7,1))+asc(mid$(s$,t+6,1))*256+asc(mid$(s$,t+5,1))*65536+asc(mid$(s$,t+4,1))*16777216 title$=mid$(s$,t+11,l-1) else title$="Unknown" end if if a>0 then l=asc(mid$(s$,a+7,1))+asc(mid$(s$,a+6,1))*256+asc(mid$(s$,a+5,1))*65536+asc(mid$(s$,a+4,1))*16777216 album$=mid$(s$,a+11,l-1) else album$="Unknown" end if close #title music$(musicnum)=album$+"~"+title$+"~"+perfo$+"~"+filepath$ musicnum=musicnum+1 next next sort music$(),1,musicnum open songpath$+"\musiclist.dat" for output as #musiclist for n= 1 to musicnum print #musiclist, music$(n) next close #musiclist wait
|
|
|
Post by DARKNIGHT on Feb 24, 2024 16:54:06 GMT -5
I take it that the file size that is Aquired by info$(1, 1) is expressed in Bytes?
|
|
|
Post by Rod on Feb 25, 2024 3:17:44 GMT -5
Yes bytes not records.
|
|
|
Post by DARKNIGHT on Feb 25, 2024 19:22:04 GMT -5
Thanks Rod wanted to verify that I was right on this
|
|
|
Post by tsh73 on Feb 26, 2024 14:32:52 GMT -5
|
|