Copy Problem on an image file?

April 24, 2012 at 01:37:16
Specs: Windows XP
I wrote a program with Visual basic 6.0 that copy a folder on a SD image file.(Simulated windows copy).
At first, I read all sectors of SD volume and copy as a file on Hard Disk (make an image file) then read all files and folders that I wish to copy after that write cluster by cluster on image file.
Finally I restore image file in SD.
I haven't any problem with Windows XP and windows7(64bit), I can read, edit and delete files and folders from SD without any problem.(I can use windows explorer)
But all files(only files) are removed after I put SD on my mobile phone.!!!! I don't know why.
I do these steps for copy folder on an image file:
1- read folder data(short-name and long-name and created date-time and ...)
2- allocate a cluster as first cluster of folder from free FAT space.
3- make folder's data on parent's directory data cluster.(Set LNF and short-name , created date and time, modified date and time, First Cluster, Attributes, and ...)
4- copy All files(see below)
5- do all steps 1 to 4 for all subfolder of it.

Copy files:
1- read short-name and long-name and created date-time and ... of file.
2- allocate a cluster as first cluster of file from free FAT space.
3- read data of file and wite them on image file and allocate more cluster if need.
4- sign last cluster with EOF.
5- do all 1 to 4 fror all files of folder.

My SD is FAT32 formated with cluster size 4096 and sector size 512.
My program change these place on SD, FAT1 and FAT2 and main ROOT and free data clusters.

See More: Copy Problem on an image file?

Report •

April 24, 2012 at 03:28:20
At a guess I'd say that your mobile phone cannot recognise the format of the image on the card so it goes & formats it in its own way - most phones/cameras insist on creating a DCIM folder, and occasionally another temp one. I suspect there isn't much you can do about it as phones/cameras aren't really designed to do what a computer can.

"I've always been mad, I know I've been mad, like the most of us..." Pink Floyd

Report •
Related Solutions

Ask Question