-3
SetCurrentDir(s); // S='//localhost/'
FindFirst(s+'*.*', faDirectory, searchResult);
x:=searchResult.Name;  // Result (name finded folder)
  1. I'm trying to find folder's in //127.0.0.1/ directory. This code dosent work in localhost directory, the result is empty.

  2. How to detect that detected folder is writeable or only read?

LU RD
  • 34,438
  • 5
  • 88
  • 296
  • 2
    I'm sorry, but this is a very weak question. Please do try to improve it. Give more details. If that code is relevant (and I cannot see where it fits) then explain what it is meant to do. Explain what the input and output are. Explain how the output fails to meet your expectations. Please do read the [faq]. – David Heffernan Apr 15 '13 at 16:43
  • 1
    To see if a folder is writeable, see [`How can I use Delphi to test if a Directory is writeable?`](http://stackoverflow.com/q/3599256/576719). – LU RD Apr 15 '13 at 17:06

1 Answers1

4

\\127.0.0.1\ is not a directory. It is the basic UNC for any folders shared on the local machine. How to list shared folders, see this question or search the web for examples:

Enumerate list of network computers and shared folders in a tree view?

Community
  • 1
  • 1
Stijn Sanders
  • 35,982
  • 11
  • 45
  • 67
  • Thanks for help, finally i used NetShareEnum – user2245316 Apr 15 '13 at 17:14
  • Works on localhost but how to check in other home network computer on localhost i use NetShareEnum(nil,..... ) for servername, NET_API_STATUS NetShareEnum( _In_ LPWSTR servername, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resume_handle ); i tried to use //computer name or computername, and it dosent work, in what form I need to define server name? yes , its my secound notebook, i got nothing. – user2245316 Apr 15 '13 at 18:41
  • @user Your question was directed at `LocalHost` specifically. If you wanted the answer to also work on other machines, you should have said so in your question. – Jerry Dodge Apr 15 '13 at 19:58
  • i need both, but it seems i handled with it, first i scan lan with ScanNetworkResources, next getting paths by – user2245316 Apr 15 '13 at 20:32