How to create a folder in a remote computer

S

shoa

Hello

I can create a folder in a local computer system by using a code:
new File("C:\\path")).mkdirs()

Now I want to create a folder in a remote computer (suppose that I have full
control of this computer and I know the IP address of this computer)

Thanks
S.Hoa
 
E

erik.koerber

Hi,

Your requirements are rather vague.

Generally speaking you'll have to access some sort of remote program
running on the remote computer (be it rcmd or your own Java program),
to which you can say that it should create the directory - supposing
you having suficient access rights...

But I suppose you already knew :).

Erik
 
J

jan V

Now I want to create a folder in a remote computer (suppose that I have
full
control of this computer and I know the IP address of this computer)

If you truly have full control of the remote machine, as you claim, then run
an FTP server on that machine, then you can use the FTP protocol to create
remote directories. Use Apache's FTP lib to make your Java program as simple
as possible.
 
H

Hack Bert

shoa said:
Hello

I can create a folder in a local computer system by using a code:
new File("C:\\path")).mkdirs()

Now I want to create a folder in a remote computer (suppose that I have full
control of this computer and I know the IP address of this computer)

Thanks
S.Hoa

If you are on Windows, you have 2 Options:

Mount the remote file space as a local drive (using either windows
explorer or the 'net use' command). The you can access it like a local
drive.

Use something thats called 'UNC' pathnames, then you would call

new File("\\\\server\\share\\path")).mkdirs()

to create a new directory in the root of the mentioned share.

hth

Hack.
 
J

jan V

If you are on Windows, you have 2 Options:

<platform neutrality sabotaging techniques snipped>

In my experience, sooner or later you curse ever having used any techniques
that bind a Java program to one OS.
 
A

Andrew Thompson

<platform neutrality sabotaging techniques snipped>

In my experience, sooner or later you curse ever having used any techniques
that bind a Java program to one OS.

It's not a problem here.

Don't forget, the OP has 'full control of this computer',
...so they can *install* Windows. ;-)
 
R

Roedy Green

I can create a folder in a local computer system by using a code:
new File("C:\\path")).mkdirs()

Now I want to create a folder in a remote computer (suppose that I have full
control of this computer and I know the IP address of this computer)

You can't do it directly unless you have LAN-style file access that
makes its drives look local.

You have to send a command to a program running on the server that
will do it for you. Part of the reason is it so awkward is you can't
just let anyone out on the net mess with your hard disk.

There are many possibilities, including:

1. you telnet in, and do a script command.

2. you FTP in and tell it to create new directory for you (limited).

3. You send a command to a Servlet that does it for you.

4. You upload a script and ask someone on the server to run it for
you.

5. You SSH in, and do a script command.

6. you use some proprietary remote file access scheme.

7. add a directory to your local replicator directory. It will be
propagated to the servers and clients.

See http://mindprod.com/jgloss/remotefileaccess.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top