B4R Question SD card: create a directory tree

peacemaker

Expert
Licensed User
Longtime User
HI, All

I read that path should be 8.3 format for FAT32.
But ... how to mkdir("/year/month/day/hour") ?
Is it impossible at all ?

Only mkdir("/year/mon") maximally possible ?
"/1/2/3/4/5/6" ?
 
Last edited:

Daestrum

Expert
Licensed User
Longtime User
each segmant of the path must be 8 or less characters, filename 8 or less, extention 3 , max path & filename & ext < 260 chars
/one/two/three/four/filename.ext - OK
/one/two/longpathname/filename.ext - not OK (although this could be changed by os to /LONG~1/ type name)
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Log(RunNative("create_dir", "/00/00".GetBytes))
Log(RunNative("create_dir", "/00/00/2".GetBytes))
Log(RunNative("create_dir", "/00/00/0000/000002".GetBytes))
No one created.
Log(RunNative("create_dir", "/test".GetBytes))
Log(RunNative("create_dir", "/test/2".GetBytes))
Both were created.
Log(RunNative("create_dir", "/t00/00".GetBytes))
Log(RunNative("create_dir", "/t00/00/0002".GetBytes))
Log(RunNative("create_dir", "/t00/00/000000000002".GetBytes))
No one created.
createDir(SD, "/t1/t2");
Failed.

I'm shocked...
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Ha !

RunNative("create_dir", "/00".GetBytes)
RunNative("create_dir", "/00/00".GetBytes)
RunNative("create_dir", "/00/00/00".GetBytes)

There works ! One by one only starting the root subfolder.
 
Last edited:
Upvote 0
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…