Midimaster Active Member Licensed User Sep 25, 2020 #1 I use Version 10.2 and recognized a strange behavior. I have a file "Piano1.wav" in a personal folder I added this file "Piano1.wav" to the project with the File Manager. Now in the file Manager it looks like "Piano1.wav" In the windows manager it appears now as "piano1.wav" in "..project/files" Now I start the app... and log the content of the DirAssets with B4X: Copy Files.ListDir(File.DirAssets) in the logger it apears as "piano1.wav" now I check the file with B4X: Copy File.Exists(File.DirAssets,"Piano1.wav") and this returns FALSE now I copy the file to DirInternal and it works!!! B4X: Copy File.Copy(File.DirAssets,FileName,File.DirInternal,FileName) here is the code B4X: Copy Sub LoadAudioSample(FileName As String) Log ("filename=" & FileName ) Log(File.ListFiles(File.DirAssets)) Log( File.Exists(File.DirAssets, FileName)) File.Copy(File.DirAssets,FileName,File.DirInternal,FileName) Log( File.Exists(File.Dirinternal, FileName)) end sub and her is the logging: .... ** Activity (main) Create, isFirst = true ** filename=Piano1.wav (ArrayList) [piano0.wav, _assets_map, piano1.wav, bassdrum.wav, snaredrum.wav, layout.bal, piano4.wav, applaus.wav, piano7.wav] false true Click to expand... Is it normal that a file "Piano1.wav" would appear as "piano1.wav" ? and also File.Exists(File.DirAssets,"Piano1.wav") would return FALSE?
I use Version 10.2 and recognized a strange behavior. I have a file "Piano1.wav" in a personal folder I added this file "Piano1.wav" to the project with the File Manager. Now in the file Manager it looks like "Piano1.wav" In the windows manager it appears now as "piano1.wav" in "..project/files" Now I start the app... and log the content of the DirAssets with B4X: Copy Files.ListDir(File.DirAssets) in the logger it apears as "piano1.wav" now I check the file with B4X: Copy File.Exists(File.DirAssets,"Piano1.wav") and this returns FALSE now I copy the file to DirInternal and it works!!! B4X: Copy File.Copy(File.DirAssets,FileName,File.DirInternal,FileName) here is the code B4X: Copy Sub LoadAudioSample(FileName As String) Log ("filename=" & FileName ) Log(File.ListFiles(File.DirAssets)) Log( File.Exists(File.DirAssets, FileName)) File.Copy(File.DirAssets,FileName,File.DirInternal,FileName) Log( File.Exists(File.Dirinternal, FileName)) end sub and her is the logging: .... ** Activity (main) Create, isFirst = true ** filename=Piano1.wav (ArrayList) [piano0.wav, _assets_map, piano1.wav, bassdrum.wav, snaredrum.wav, layout.bal, piano4.wav, applaus.wav, piano7.wav] false true Click to expand... Is it normal that a file "Piano1.wav" would appear as "piano1.wav" ? and also File.Exists(File.DirAssets,"Piano1.wav") would return FALSE?
Sandman Expert Licensed User Longtime User Sep 25, 2020 #2 I have a vague memory of Erel making the filenames lowercase as a way of normalizing them. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2020 #3 Moved to the questions forum. All asset files are lower cased. This happens automatically when you add the files to the files tab. It will also happen after you click on the Sync button, in case you added a file to the Files folder directly. File.Exists doesn't work with the assets folder and is not really needed as you know which files are there. Upvote 0
Moved to the questions forum. All asset files are lower cased. This happens automatically when you add the files to the files tab. It will also happen after you click on the Sync button, in case you added a file to the Files folder directly. File.Exists doesn't work with the assets folder and is not really needed as you know which files are there.
Midimaster Active Member Licensed User Sep 25, 2020 #4 lower case: ok. I did no realize this until today. file.exists: this makes sense, of course. I would have needed the exact FileSize of a dozend of WAV-files in the DirAssets to kick away the 44Bytes of header when loading them. Now I copied the files to the DirInternal and scanned them there. Upvote 0
lower case: ok. I did no realize this until today. file.exists: this makes sense, of course. I would have needed the exact FileSize of a dozend of WAV-files in the DirAssets to kick away the 44Bytes of header when loading them. Now I copied the files to the DirInternal and scanned them there.