B4J Question [B4J question] Is there any tricks to handle the character ":" in filename?

johnerikson

Active Member
Licensed User
Longtime User
Have a specific problem with images stored in a database with file name that contains the character ":". The file name has identity with the date and time such as. "2015-06 -13 _ 05:13:25_256". It is no problem to handle this type of file name in B4A.

But.. With B4J you cannot copy (file copy), rename (MF_file, rename) or read a blob (file. Openoutput) from the database and save with ":" in the filename. On the other hand, it has been good to write in the database then the file name is a string and file data is a blob in a table .

Is there any tricks to deal with ":" in filename with B4J?

In other cases, I have to rule out the ":" in the file names and convert B4A app and WEB App in B4j and convert the database, a huge job!!!
 

Ed Brown

Active Member
Licensed User
Longtime User
Hi johnerikson,

Windows (assuming you are using Windows based on the issue of using ':') does not permit colon characters in filenames. If the image is stored in a database you can read the image and filename and simply change the filename that is Windows friendly.

There is information about Windows filename conventions here https://msdn.microsoft.com/en-au/library/windows/desktop/aa365247(v=vs.85).aspx
 
Upvote 0

johnerikson

Active Member
Licensed User
Longtime User
Excuse me for a stupid question!
I wonder if that's because I worked a lot with the Android OS or is it a consequence of being able to use the same programming language to different OS.

Thanks anyway!
 
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
Hi johneriskon,

It's not a stupid question at all.

Android is a variation of linux/unix and with these OS's (Android, linux/unix, Mac OS-X, etc) colons can be used in filenames. Windows, on the other hand, will not allow colons - I do not know why it does not allow colons.

There will be, I'm sure, other differences between the two OS's besides file naming conventions...I can't think of any off the top of my head. It's what makes cross-platform development a challenge.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…