path to iPhone DCIM Directory

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

when connect my iPhone to Windows 10 via USB i go a new Device "Apple iPhone"
i can open Folder with Explorer and get to "This PC\Apple iPhone\Internal Storage\DCIM"

Question : how get to that Folder with harbour / HMG :idea:

iPhone is not shown as Storage only as
Apple Mobile Device USB Composite Device
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: path to iPhone DCIM Directory

Post by danielmaximiliano »

*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi
thx for Link, i will study it
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

i have work on link
https://stackoverflow.com/questions/110 ... n-windows
and i got "full-path" and file-Name

Code: Select all

   cItem := "APPLE IPHONE"
   oShell := CreateObject( "shell.application" )
   IF NIL <> oShell
      oFolder := oShell:NameSpace(CSIDL_DRIVES ) // 0x0011 // My Computer
      IF NIL <> oFolder
         oItems := oFolder:Items()
         iMax := oItems:Count
         FOR i := 1 TO iMax
            oItem := oItems:Item( i - 1 )
            IF !EMPTY( oItem )
               cName := UPPER( oItem:name )
               IF cName = cItem                  // "APPLE IPHONE"
                  cPath := oItem:path            // GUID ?
next was Sub-Folder to get to folder with Image

Code: Select all

 oFolderItem := oItem:GetFolder:items  // "APPLE IPHONE"
  objFolder := oThis:GetFolder:Items   // "Internal Storage"
   oItemL := oItemF:GetFolder:Items    // "DCIM"
    oItemN := oItemM:GetFolder:Items   // "103APPLE"
    nMax := oItemN:Count
    FOR n := 1 TO nMax
      oFile := oItemN:Item( n - 1 )
      cThis := oFile:name
      cSrcP := oFile:Path
      AADD(aFiles,{cThis,cPath,cSrcP})
    NEXT
now i have try to use CopyFile API ...
https://docs.microsoft.com/en-us/previo ... dfrom=MSDN

Code: Select all

   IF !EMPTY(aFiles)
      fso := CreateObject("Scripting.FileSystemObject")
      iMax := LEN(aFiles)
      FOR i := 1 TO iMax
         cFile := aFiles[i][3]
         cFile += "\"
         cFile += aFiles[i][1]
         fso:CopyFile(cFile,cTarget)
      NEXT
      fso := NIL
   ENDIF
but something is going wrong
CopyFile.jpg
CopyFile.jpg (73.7 KiB) Viewed 2592 times
i "think" something in "Path" (cSrcP) is wrong ... or is it my Syntax :idea:
IPHONE01.ZIP
(1.01 KiB) Downloaded 123 times
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: path to iPhone DCIM Directory

Post by danielmaximiliano »

Hi Jimmy:
I do not have Ihpone, I have Motorola G8 plus that also delivers a Virtual unit like MotoG8 inside the unit: Internal storage and SD card, I see that it is well on track with its source code, my point of view is how to work with FileCopy in virtual drives since I did not fully read the link I sent you or the Harbor code, nor did I know how to find out the virtual drives on your PC.

Hola Jimmy : no tengo Ihpone, tengo Motorola G8 plus que tambien entrega una unidad Virtual como MotoG8 dentro la unidad: Almacenamiento interno y SD card, veo que va bien encaminado con su codigo fuente, mi punto de vista es como trabajar con FileCopy en las unidades virtuales ya que no lei completamente el enlace que le envie ni el codigo Harbour, tampoco se como hizo para averiguar las unidades virtuales en su PC.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: path to iPhone DCIM Directory

Post by danielmaximiliano »

AUGE_OHR wrote: Sun Mar 29, 2020 7:16 am hi

now i have try to use CopyFile API ...
https://docs.microsoft.com/en-us/previo ... dfrom=MSDN

Code: Select all

   IF !EMPTY(aFiles)
      fso := CreateObject("Scripting.FileSystemObject")
      iMax := LEN(aFiles)
      FOR i := 1 TO iMax
         cFile := aFiles[i][3]
         cFile += "\"
         cFile += aFiles[i][1]
         fso:CopyFile(cFile,cTarget)
      NEXT
      fso := NIL
   ENDIF
but something is going wrong
CopyFile.jpg
i "think" something in "Path" (cSrcP) is wrong ... or is it my Syntax :idea:
IPHONE01.ZIP
https://docs.microsoft.com/en-us/window ... e-copyfile
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

it seems more complicate

Code: Select all

   fsMyStream = System.IO.File.Open(taregetFullFileName, IO.FileMode.Open, IO.FileAccess.ReadWrite)
   fsMyStream.Close()
i have to create a Stream to "Copy" ... :roll:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

go it :D
after get "Folder" 103APPLE i use this to copy hole Folder

Code: Select all

PROCEDURE DoCopyHere(oAppleFile, cTarget )
LOCAL obj := CreateObject( "Shell.Application" )
LOCAL oFolder := obj:NameSpace(  cTarget )
   oFolder:CopyHere(oAppleFile)
RETURN
---

i guess it work also for "other" Device when display under "My Computer"
will make a full Demo ...
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

have try next Step to select wanted Images
HMG_GetIPhoneImage.jpg
HMG_GetIPhoneImage.jpg (150.85 KiB) Viewed 2511 times
but i have to figure out how to "transfer" with COPYHERE()
https://docs.microsoft.com/en-us/window ... r-copyhere

p.s. Size 0 and funny Date ... hm
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

i "remember" that i have use COPYHERE before ... to ZIP Files :D

Problem was : COPYHERE work Asynchrone so it need a "Trick"

Code: Select all

PROCEDURE DoCopySingle( oDirFolder, cTarget )
LOCAL obj     := CreateObject( "Shell.Application" )
LOCAL oTarget := obj:NameSpace( cTarget )
LOCAL xFlag   := FOF_SIMPLEPROGRESS
LOCAL aFiles  := {}
LOCAL oFile, cFile, xCount, nCount, i, iMax, nSkip := 0

   iMax := oDirFolder:Count
   FOR i := 1 TO iMax
      // if Checkbox is marked
      IF IPHONE.Grid_1.CheckBoxItem( i ) = .T.
         // get Item Object
         oFile := oDirFolder:Item( i - 1 )
         // copy / stram single Object file
         oTarget:CopyHere( oFile, xFlag )
         // wait until all files are written
         xCount := 0
         DO WHILE .T.
            // compare if file is written
            nCount := oTarget:items() :Count()
            IF nCount + nSkip >= i
               EXIT
            ENDIF
            SLEEP( 10 )
            xCount ++
            IF xCount > 50
               EXIT
            ENDIF
         ENDDO
      ELSE
         // Skip un-marked
         nSkip ++
      ENDIF
      IPHONE.ProgressBar_1.Value := CalcPos(i, iMax )
   NEXT
   // clean up
   IPHONE.ProgressBar_1.Value := 0
   oTarget := NIL
   obj := NIL
RETURN
have fun
Jimmy
Post Reply