AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

TPath.GetIrgendwas

Ein Thema von himitsu · begonnen am 15. Okt 2016 · letzter Beitrag vom 24. Okt 2016
Antwort Antwort
Rollo62

Registriert seit: 15. Mär 2007
4.171 Beiträge
 
Delphi 12 Athens
 
#1

AW: TPath.GetIrgendwas

  Alt 20. Okt 2016, 17:11
Da wäre noch die Frage, gibt es eigentlich unterschiedliche Implementierungen von Android ?

Also ich meine Samsung hat andere Pfade oder Zugriffsrechte als Nexus oder LG ?
Hat da mal einer schlechte Erfahrungen gemacht ?

Rollo
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.361 Beiträge
 
Delphi 12 Athens
 
#2

AW: TPath.GetIrgendwas

  Alt 20. Okt 2016, 17:26
Alle TPath.Get-Funktionen fragen auf den jeweiligem System das OS nach den "aktuelen" Pfaden für das, was man grade haben will.

Wenn z.B. der Pfad für deine Fotos unterschiedlich ist, dann "sollte" TPath.DetPicturePath auch jeweils das Richtige liefern.
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.361 Beiträge
 
Delphi 12 Athens
 
#3

AW: TPath.GetIrgendwas

  Alt 23. Okt 2016, 01:39
Ich hatte mich mal bissl umgeguckt und vorallem das aus OH/Doku von Delphi/Android/Apple und meinen alten RTL-Quellcodes zusammengefasst.
Im Prinzip sind das die Pfade, auf die man in den verschiedenen OS Zugriff drauf hat, so weit ich das richtig erkannt hab.
iOS Data Storage Guidelines
File System Programming Guide
File System Programming Guide (OSX)
  • Warum zeigen in iOS/OSX die TPath.GetSchared nicht auf Unterverzeichnisse von "Public"?
  • GetDownloadPath für Windows stimmt auch mit keinem Standardpfad irgendeines Browsers überein.
  • GetSharedDocumentsPath beim Android ist nicht Shared, aber dafür ist GetDocumentsPath Shared.
  • Und obwohl in der OH bei jeder GetPath-Methode als Erstes steht, dass diese Methoden ein '' zurückgeben, wenn der Path nicht vorhanden ist, tuten sie das nicht. (Ja, weiter unten steht manchmal nochma das Gegenteil, aber egal)

Also jeweils OS, die Hauptunktion, welche drauf zeigt, und dann noch der Pfad, alles sortiert nach Pfaden.
Code:
Android        GetLibraryPath             /data/app-lib/:AppID:
Android        GetCachePath               /data/data/:AppID:/cache
Android        GetDocumentsPath&HomePath  /data/data/:AppID:/files
Android        GetPublicPath              /storage/emulated/0/Android/data/:AppID:/files
Android        GetAlarmsPath              /storage/emulated/0/Android/data/:AppID:/files/Alarms
Android        GetCameraPath              /storage/emulated/0/Android/data/:AppID:/files/DCIM
Android        GetDownloadsPath           /storage/emulated/0/Android/data/:AppID:/files/Download
Android        GetMoviesPath              /storage/emulated/0/Android/data/:AppID:/files/Movies
Android        GetMusicPath               /storage/emulated/0/Android/data/:AppID:/files/Music
Android        GetPicturesPath            /storage/emulated/0/Android/data/:AppID:/files/Pictures
Android        GetRingtonesPath           /storage/emulated/0/Android/data/:AppID:/files/Ringtones
Android                                    /storage/emulated/0/Android/data/:AppID:/files/cache
Android                                    /storage/emulated/0/Android/data/:AppID:/files/files
Android        GetTempPath                /storage/emulated/0/Android/data/:AppID:/files/tmp
Android        GetSharedAlarmsPath        /storage/emulated/0/Alarms
Android                                    /storage/emulated/0/DCIM
Android        GetSharedDownloadsPath     /storage/emulated/0/Download
Android        GetSharedMoviesPath        /storage/emulated/0/Movies
Android        GetSharedMusicPath         /storage/emulated/0/Music
Android        GetSharedPicturesPath      /storage/emulated/0/Pictures
Android        GetSharedRingtonesPath     /storage/emulated/0/Ringtones


iOS-Gerät      GetHomePath                /private/var/mobile/Applications/:AppID:
iOS-Gerät      GetTempPath                /private/var/mobile/Applications/:AppID:/tmp
iOS-Simulator  GetHomePath                /var/mobile/Applications/:AppID:
iOS            GetDocumentsPath           /var/mobile/Applications/:AppID:/Documents
iOS-Simulator  GetDownloadsPath           /var/mobile/Applications/:AppID:/Downloads
iOS            GetLibraryPath             /var/mobile/Applications/:AppID:/Library
iOS            GetCachePath               /var/mobile/Applications/:AppID:/Library/Caches
iOS-Simulator  GetMoviesPath              /var/mobile/Applications/:AppID:/Movies
iOS-Simulator  GetMusicPath               /var/mobile/Applications/:AppID:/Music
iOS-Simulator  GetPicturesPath            /var/mobile/Applications/:AppID:/Pictures
iOS-Simulator  GetPublicPath              /var/mobile/Applications/:AppID:/Public
iOS-Simulator  GetTempPath                /var/mobile/Applications/:AppID:/tmp

iOS            shared files               only via Public-directories, iCloud or similar (application are sandboxed)
iOS-Simulator  -                           /var/mobile/Applications -> /Users/:UserName:/Library/Application Support/iPhone Simulator/<SDK-Version>/Applications


Mac OS X       ud GetHomePath             /Users/:UserName:
Mac OS X       user domain                /Users/:UserName:/Desktop
Mac OS X       ud GetDocumentsPath        /Users/:UserName:/Documents
Mac OS X       ud GetDownloadsPath        /Users/:UserName:/Downloads
Mac OS X       ud GetLibraryPath          /Users/:UserName:/Library
Mac OS X       ud GetCachePath            /Users/:UserName:/Library/Caches
Mac OS X       ud GetMoviesPath           /Users/:UserName:/Movies
Mac OS X       ud GetMusicPath            /Users/:UserName:/Music
Mac OS X       ud GetPicturesPath         /Users/:UserName:/Pictures
Mac OS X       ud GetPublicPath           /Users/:UserName:/Public
Mac OS X       user domain                /Users/Shared
Mac OS X       -  GetTempPath             /var/folders/:RandomDir:
Mac OS X       local domain               /Applications
Mac OS X       local domain               /Applications/Utilities
Mac OS X       local domain               /Developer
Mac OS X       local domain               /Library
Mac OS X       system domain              /System
Mac OS X       system domain              /System/Library

iOS /Mac OS    the Public directory is accessible by other users/applications on the system


Windows        GetCache&DownloadsPath     C:\Users\:UserName:\AppData\Local
Windows        GetTempPath                C:\Users\:UserName:\AppData\Local\Temp
Windows        GetHomePath                C:\Users\:UserName:\AppData\Roaming
Windows        GetPicturesPath            C:\Users\:UserName:\Pictures
Windows        GetDocumentsPath           C:\Users\:UserName:\Documents
Windows        GetMoviesPath              C:\Users\:UserName:\Videos
Windows        GetMusicPath               C:\Users\:UserName:\Music
Windows        GetSharedPicturesPath      C:\Users\Public\Pictures
Windows        GetSharedDocumentsPath     C:\Users\Public\Documents
Windows        GetSharedMusicPath         C:\Users\Public\Music
Windows        GetSharedMoviesPath        C:\Users\Public\Videos
Windows        GetPublicPath              C:\ProgramData
Windows        GetLibraryPath             C:\Program Files\:InstallPath:
Und 'ne kleine Testfunktion, welche Nachfolgendes anzeigt.
Delphi-Quellcode:
uses
  System.IOUtils;

procedure TForm6.FormShow(Sender: TObject);
begin
  Memo1.Lines.Clear;
  Memo1.Lines.Add('GetLibraryPath ' + TPath.GetLibraryPath);
  Memo1.Lines.Add('');
  Memo1.Lines.Add('GetHomePath ' + TPath.GetHomePath);
  Memo1.Lines.Add('GetCachePath ' + TPath.GetCachePath);
  Memo1.Lines.Add('GetTempPath ' + TPath.GetTempPath);
  Memo1.Lines.Add('GetPublicPath ' + TPath.GetPublicPath);
  Memo1.Lines.Add('');
  Memo1.Lines.Add('GetDocumentsPath ' + TPath.GetDocumentsPath);
  Memo1.Lines.Add('GetPicturesPath ' + TPath.GetPicturesPath);
  Memo1.Lines.Add('GetCameraPath ' + TPath.GetCameraPath);
  Memo1.Lines.Add('GetMusicPath ' + TPath.GetMusicPath);
  Memo1.Lines.Add('GetAlarmsPath ' + TPath.GetAlarmsPath);
  Memo1.Lines.Add('GetRingtonesPath ' + TPath.GetRingtonesPath);
  Memo1.Lines.Add('GetMoviesPath ' + TPath.GetMoviesPath);
  Memo1.Lines.Add('GetDownloadsPath ' + TPath.GetDownloadsPath);
  Memo1.Lines.Add('');
  Memo1.Lines.Add('GetSharedDocumentsPath ' + TPath.GetSharedDocumentsPath);
  Memo1.Lines.Add('GetSharedPicturesPath ' + TPath.GetSharedPicturesPath);
  Memo1.Lines.Add('GetSharedCameraPath ' + TPath.GetSharedCameraPath);
  Memo1.Lines.Add('GetSharedMusicPath ' + TPath.GetSharedMusicPath);
  Memo1.Lines.Add('GetSharedAlarmsPath ' + TPath.GetSharedAlarmsPath);
  Memo1.Lines.Add('GetSharedRingtonesPath ' + TPath.GetSharedRingtonesPath);
  Memo1.Lines.Add('GetSharedMoviesPath ' + TPath.GetSharedMoviesPath);
  Memo1.Lines.Add('GetSharedDownloadsPath ' + TPath.GetSharedDownloadsPath);
end;
Windows 7:
Code:
GetLibraryPath        C:\Users\Frank\Documents\Embarcadero\Studio\Projekte\Win32\Debug\

GetHomePath           C:\Users\Frank\AppData\Roaming
GetCachePath          C:\Users\Frank\AppData\Local
GetTempPath           C:\Users\Frank\AppData\Local\Temp\
GetPublicPath         C:\ProgramData

GetDocumentsPath      C:\Users\Frank\Documents
GetPicturesPath       C:\Users\Frank\Pictures
GetCameraPath         C:\Users\Frank\Pictures
GetMusicPath          C:\Users\Frank\Music
GetAlarmsPath         C:\Users\Frank\Music
GetRingtonesPath      C:\Users\Frank\Music
GetMoviesPath         C:\Users\Frank\Videos
GetDownloadsPath      C:\Users\Frank\AppData\Local

GetSharedDocumentsPath C:\Users\Public\Documents
GetSharedPicturesPath C:\Users\Public\Pictures
GetSharedCameraPath   C:\Users\Public\Pictures
GetSharedMusicPath    C:\Users\Public\Music
GetSharedAlarmsPath   C:\Users\Public\Music
GetSharedRingtonesPath C:\Users\Public\Music
GetSharedMoviesPath   C:\Users\Public\Videos
GetSharedDownloadsPath C:\ProgramData
Android 4:
Code:
GetLibraryPath        /data/app-lib/com.embarcadero.Project6-1

GetHomePath           /data/data/com.embarcadero.Project6/files
GetCachePath          /data/data/com.embarcadero.Project6/cache
GetTempPath           /storage/emulated/0/Android/data/com.embarcadero.Project6/files/tmp
GetPublicPath         /storage/emulated/0/Android/data/com.embarcadero.Project6/files

GetDocumentsPath      /data/data/com.embarcadero.Project6/files
GetPicturesPath       /storage/emulated/0/Android/data/com.embarcadero.Project6/files/Pictures
GetCameraPath         /storage/emulated/0/Android/data/com.embarcadero.Project6/files/DCIM
GetMusicPath          /storage/emulated/0/Android/data/com.embarcadero.Project6/files/Music
GetAlarmsPath         /storage/emulated/0/Android/data/com.embarcadero.Project6/files/Alarms
GetRingtonesPath      /storage/emulated/0/Android/data/com.embarcadero.Project6/files/Ringtones
GetMoviesPath         /storage/emulated/0/Android/data/com.embarcadero.Project6/files/Movies
GetDownloadsPath      /storage/emulated/0/Android/data/com.embarcadero.Project6/files/Download

GetSharedDocumentsPath /storage/emulated/0/Android/data/com.embarcadero.Project6/files
GetSharedPicturesPath /storage/emulated/0/Pictures
GetSharedCameraPath   /storage/emulated/0/DCIM
GetSharedMusicPath    /storage/emulated/0/Music
GetSharedAlarmsPath   /storage/emulated/0/Alarms
GetSharedRingtonesPath /storage/emulated/0/Ringtones
GetSharedMoviesPath   /storage/emulated/0/Movies
GetSharedDownloadsPath /storage/emulated/0/Download
Android 5 konnte ich nicht gucken, da meine Delphi-Programme da nicht mehr laufen.
Application does not support this System
und OSX/iOS hab'sch net.
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
t.roller
(Gast)

n/a Beiträge
 
#4

AW: TPath.GetIrgendwas

  Alt 23. Okt 2016, 07:05
Bei WIN8.1 kommt aber manchmal Unsinn heraus:

GetLibraryPath C:\Users\Roller\Documents\Embarcadero\Studio\Proje kte\20161022-TabControl\Win32\Debug\

GetHomePath C:\Users\Roller\AppData\Roaming
GetCachePath C:\Users\Roller\AppData\Local
GetTempPath C:\Users\Roller\AppData\Local\Temp\
GetPublicPath C:\ProgramData

GetDocumentsPath C:\Users\Roller\Documents
GetPicturesPath C:\Users\Roller\Pictures
GetCameraPath C:\Users\Roller\Pictures
GetMusicPath C:\Users\Roller\Music
GetAlarmsPath C:\Users\Roller\Music
GetRingtonesPath C:\Users\Roller\Music
GetMoviesPath C:\Users\Roller\Videos
GetDownloadsPath C:\Users\Roller\AppData\Local

GetSharedDocumentsPath C:\Users\Public\Documents
GetSharedPicturesPath C:\Users\Public\Pictures
GetSharedCameraPath C:\Users\Public\Pictures
GetSharedMusicPath C:\Users\Public\Music
GetSharedAlarmsPath C:\Users\Public\Music
GetSharedRingtonesPath C:\Users\Public\Music
GetSharedMoviesPath C:\Users\Public\Videos
GetSharedDownloadsPath C:\ProgramData
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.361 Beiträge
 
Delphi 12 Athens
 
#5

AW: TPath.GetIrgendwas

  Alt 23. Okt 2016, 12:21
Sieht eigentlich "normal" aus, also was Embarcadero für normal hält.

Viele Pfade gibt es nicht und anstatt dann auch Nichts zurückgegeben wird, wird das umgeleitet.
Vorallem bei Camera, Alarm und Ringtone

Aber ganz Krank finde ich einfach PublicPath und SharedDownloadsPath ... da werden die öffentlichen/runtergeladenen Dateien in einem unsichtbaren Verzeichnis versenkt, denn im Explorer sieht der User standardmäßig C:\ProgramData garnicht, also kann man das nicht als Öffentlich ansehn.
Ein Therapeut entspricht 1024 Gigapeut.

Geändert von himitsu (23. Okt 2016 um 12:24 Uhr)
  Mit Zitat antworten Zitat
Rollo62

Registriert seit: 15. Mär 2007
4.171 Beiträge
 
Delphi 12 Athens
 
#6

AW: TPath.GetIrgendwas

  Alt 24. Okt 2016, 06:42
Hallo Himitzu,

danke für die tolle Liste, werde ich hier auch nochmal gegenchecken auf verschiedenen Geräten.

Eins ist mir aber nicht ganz klar:
Zitat:
GetSharedDocumentsPath beim Android ist nicht Shared, aber dafür ist GetDocumentsPath Shared.
Das fehlt aber unten, ist das ein Typo, und du meinst GetSharedDownloadsPath ?

Zitat:
Android GetLibraryPath /data/app-lib/:AppID:
Android GetCachePath /data/data/:AppID:/cache
Android GetDocumentsPath&HomePath /data/data/:AppID:/files
Android GetPublicPath /storage/emulated/0/Android/data/:AppID:/files
Android GetAlarmsPath /storage/emulated/0/Android/data/:AppID:/files/Alarms
Android GetCameraPath /storage/emulated/0/Android/data/:AppID:/files/DCIM
Android GetDownloadsPath /storage/emulated/0/Android/data/:AppID:/files/Download
Android GetMoviesPath /storage/emulated/0/Android/data/:AppID:/files/Movies
Android GetMusicPath /storage/emulated/0/Android/data/:AppID:/files/Music
Android GetPicturesPath /storage/emulated/0/Android/data/:AppID:/files/Pictures
Android GetRingtonesPath /storage/emulated/0/Android/data/:AppID:/files/Ringtones
Android /storage/emulated/0/Android/data/:AppID:/files/cache
Android /storage/emulated/0/Android/data/:AppID:/files/files
Android GetTempPath /storage/emulated/0/Android/data/:AppID:/files/tmp
Android GetSharedAlarmsPath /storage/emulated/0/Alarms
Android /storage/emulated/0/DCIM
Android GetSharedDownloadsPath /storage/emulated/0/Download
Android GetSharedMoviesPath /storage/emulated/0/Movies
Android GetSharedMusicPath /storage/emulated/0/Music
Android GetSharedPicturesPath /storage/emulated/0/Pictures
Android GetSharedRingtonesPath /storage/emulated/0/Ringtones
Rolf
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.361 Beiträge
 
Delphi 12 Athens
 
#7

AW: TPath.GetIrgendwas

  Alt 24. Okt 2016, 10:52
Darum "frage" ich hier ja nochmal nach, hab ja kein iOS/OSX, aber bei den meisten anderen Pfaden sah es so aus, als ob die Grundstruktur gleich sei.

Delphi-Referenz durchsuchenIOUtils.TPath.GetPublicPath
NSSharedPublicDirectory wird unabhängig vom Simulator immer für iOS aufgerufen.
Ein halbwegs gesunder Menschenverstand hätte mich jetzt vermuten lassen, dass es intelligenter wäre, wenn der Simmulator "ähnlich" funktioniert, wie das zu simulierende Gerät.
Es wäre doch zu blöd, wenn man das Programm testet, es da läuft und dann auf den Zielgerät nicht mehr?

Aber darum auch der Testcode, so dass jemand anderes auch mal auf dem iOS-Simulator und einem der vielen iOS-Geräte nachsehen könnte, was es nun wirklich gibt.
Mein altes Delphi mag auch kein Andriod 5 und das jetzt, wo mein neues Tablet endlich aus der Reparatur zurück ist.


Das fehlt aber unten, ist das ein Typo, und du meinst GetSharedDownloadsPath ?
In der oberen Liste sind nur alle mir bisher aufgefallenen Verzeichnisse drin und jeweils eine oder zwei TPath-Methoden, welche diesen Pfad zurück gibt.
Also die wichtigste Methode, anhand des Namen der Funktion und des Verzeichnisses, wenn sie funktionell übereinstimmen.
Es kann da auch noch andere Methoden geben und es gibt auch noch Funktionen (z.B. Delphi-Referenz durchsuchenSysUtils.GetHomePath)
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz