Accessing network filesystem

Creating a macro - Writing a Script - Using the API

Accessing network filesystem

Postby mobi-doc » Fri Feb 15, 2008 1:52 am

In Windows I can access home network filesystem like:

dir \\COMPUTERNAME\sharedfoldername\*.*

This notation doesn't seem to work with OOBASIC.
Is there any way with BASIC or using UNO services to access files and directories on another home network computer?

Thanks in advance.
mobi-doc
 
Posts: 59
Joined: Wed Nov 21, 2007 11:29 am
Location: Greece

Re: Accessing network filesystem

Postby TerryE » Fri Feb 15, 2008 6:26 am

try
Code: Select all   Expand viewCollapse view
Sub Main
print ConvertToURL("\\COMPUTERNAME\sharedfoldername\*.*")
print ConvertToURL("D:\*.*")
End Sub

The reason for the 3 /s in file: an http: URLs is that they go //hostname/restOfTheFileDescriptor. /// = localhost
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
TerryE
Volunteer
 
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: Accessing network filesystem

Postby mobi-doc » Fri Feb 15, 2008 9:39 am

Yes but a
Code: Select all   Expand viewCollapse view
print dir("\\COMPUTERNAME\sharefoldername\")
returns always an empty string. Conversions working but the file accessing part is problematic.
mobi-doc
 
Posts: 59
Joined: Wed Nov 21, 2007 11:29 am
Location: Greece

Re: Accessing network filesystem

Postby TerryE » Fri Feb 15, 2008 1:54 pm

Yup, there does seem to be a issue here with UNC enumeration in the dir function. I haven't tried other operations such as open. A work around is to use explorer to map the network drive, or do a net use X: \\COMPUTERNAME\sharedfoldername at the command prompt. You will find that dir "X:\*.*" works fine.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
TerryE
Volunteer
 
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: Accessing network filesystem

Postby mobi-doc » Fri Feb 15, 2008 2:07 pm

In my case that's not enough. I'm trying to write a stand-alone File and Directory Synchronization application using Base, that would work in local files as well as local networks with Windows or Linux machines. UNO is perfect for hiding OS specific differences, and I would like a UNO solution to this problem.

Thanks anyway.
mobi-doc
 
Posts: 59
Joined: Wed Nov 21, 2007 11:29 am
Location: Greece


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 6 guests