Autor Beitrag
delphia
Hält's aus hier
Beiträge: 16



BeitragVerfasst: Di 21.04.09 12:06 
Hallo,

ich habe einen Anwender der unter Vista arbeitet. Bei dem sind die Listen von Dateien, die ich mittels FindFirst und FindNext zusammenstelle leer. Hier bei mir unter XP läuft das ohne Probleme. Der Zugriff auf die Dateien an anderen Stellen im Programm unter Vista ist kein Problem.

Ich arbeite mit D5 #1 unter XP Pro SP2.

In der Quelldatei von sysutils.pas bzw. windows.pas habe ich gesehen dass die Funktion FindFirst von Delphi auf eine Funktion im Windows Kernel FindFirstFile zugreift. Daher die Idee es könnte mit der Windowsversion zu tun haben.

Wenn die Funktion FindFirst unter Vista nicht arbeitete, gibt es da einen workaround?

Danke und Gruss Thomas
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 21.04.09 12:25 
Welchen Pfad versuchst Du mit FindFirst\FindNext zu durchsuchen? Unter Vista sind viele Verzeichnisse nur virtuell eingehangen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Bernhard Geyer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 721
Erhaltene Danke: 3



BeitragVerfasst: Di 21.04.09 20:44 
Dann zeig doch mal etwas mehr Quellcode und die Info welche Verzeichniss du verwendet. Neben der virtualisierung könntest du auch noch damit Probleme haben da die Standard-verzeichnissnamen alle englisch sind: Angezeigt "C:\Programm", im Dateisystem "C:\Program Files"
delphia Threadstarter
Hält's aus hier
Beiträge: 16



BeitragVerfasst: Mi 22.04.09 14:08 
Hallo,

dursucht werden nur applikationseigene Verzeichnisse allerdings auf einem Laufwerk, das über das Netzwerk erreichbar ist, also gemappt ist.

Der Code ist unspekatkulär:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
procedure FilesInDir(Pfad, Mask:string; var Liste : TStrings; Action : TfidActionType);
var
  Gefunden : TSearchRec;
  Path : string;
begin
    try
    if FindFirst(Pfad + Mask, faAnyFile, Gefunden) = 0 then
    begin
        if not (fidAppend in Action) then Liste.Clear;
        if (fidWithPath in Action) then
            Path := (IncludeTrailingBackslash(Pfad))
        else
           Path := '';

        if (fidCutExtension in Action) then
           Liste.Add(Path + ExtractPureFileName(Gefunden.Name))
        else
          Liste.Add(Path + Gefunden.Name);

        while (FindNext(Gefunden) = 0) do
        begin
            if (fidCutExtension in Action) then
               Liste.Add(Path + ExtractPureFileName(Gefunden.Name))
            else
               Liste.Add(Path + Gefunden.Name);
        end;
    end;
    finally
    FindClose(Gefunden);
    end;
end;


Angezeigt wird das Suchresultat in Listboxen bzw. Comboboxen.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 22.04.09 19:32 
Welche Berechtigungen sind gesetzt? ACLs? Mit welchen Rechten läuft die Anwendung?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
delphia Threadstarter
Hält's aus hier
Beiträge: 16



BeitragVerfasst: Do 23.04.09 13:49 
Tach,

Rechte? Ja genau weiß ich das nicht. Ich gehe aber mal davon aus, dass es damit nichts zu tun hat, da von den Arbeitsplatzrechnern die Dateien, die gelistete werden sollen, sowohl geöffnet (im selben Anwenungspreogramm) also auch editiert (Windows Explorer) werden können.


Gruss
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 23.04.09 14:16 
Geh mal in eine Kommandozeile (CMD), wechsel in das Verzeichnis (CD /D ...) und gib CACLS ein. Das sagt die Berechtigungen an.

Ansonsten: Prüf mal, was GetLastError nach jedem Aufruf sagt (FindFirst\FindNext). Sollte normalerweise immer alles 0 sein.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Do 23.04.09 14:32 
Wie rufst du die Prozedur denn auf? Genauer, was steht in Pfad?

_________________
PROGRAMMER: A device for converting coffee into software.