Re: Local Area Network Access

new topic     » goto parent     » topic index » view thread      » older message » newer message

There's no reason why you can't use walk_dir in a win32xxx based program. Just because you're using the Windows API for the UI, it doesn't stop you from using the built-in Euphoria functions for everything else. If you are running Windows, you don't have the option of using DOS. The cmd window and the associated shell commands (like dir, chdir, etc.) are all part of Windows, and they just work. Be careful not to over-engineer the solution. If you are on a network, and you want to access files on a remote computer, as long as you know the computer name and as long as the computer is on and on the network, you can treat those remote files exactly the same as you would treat any local file or directory. It's built into Windows; you don't need any special API for it. If you don't know the computer name, I have to wonder how you can know the names and locations of the files you want to copy.

Here is a simple example of creating a file on a remote computer. All other file-related operations work the exact same way:

 
fn = open("\\\\pa-files2\\data\\pa_data\\_stats\\"&userdata[2],"w") 
if fn < 3 then 
  abort(1) 
end if 
 

Userdata is a sequence populated with information about the local computer. Field 2 happens to be the serial number. Later on I do this:

dlist = dir("C:\\Program Files") 
if sequence(dlist) and length(dlist)>0 then 
  puts(fn,"Contents of Program files directory:\n") 
  for ctr = 1 to length(dlist) do 
    puts(fn,"   "&dlist[ctr][1]&"\n") 
  end for 
end if 

How I have a hidden directory on a remote server that contains a file for each workstation with the contents of the program files directory, along with some other helpful information. I use it to diagnose any potentially harmful or out-of-date software installed on my network against company policy. This runs on Windows natively, no special API or DOS required.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu