By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,989 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,989 IT Pros & Developers. It's quick & easy.

Fast Rename from client to server

P: n/a
I have a C# client app that sometimes needs to do thousands of specialized
file renames of files on a file server in the same domain. If the files
reside locally on the client machine, the renames take only a few seconds.
If the files reside on the file server, a set of 30,000 file renames may take
a half hour to do.

I'm just using File.Move to do the rename. The renames are not moving the
files to a different folder, they are just changing the name of the file.

I'm assuming that network latency between each of the File.Move calls is
what is slowing the renaming down so much.

Is there a way to batch up all 30,000 File.Move commands to the server,
rather than sending them each one at a time so that I am not paying the price
of the network latency between every single file rename? Or is there a
better way to speed this up? It needs to be almost as fast as doing it
locally on the client.

Mar 29 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Hi,

No, you cannot batch them.

Can you install/run a remote program in the server?
You could send the execution to the remote service which will do it locally.

That would be the practical solution from my point of view.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Don Curtis" <Fa*******@online.nospam> wrote in message
news:8C**********************************@microsof t.com...
I have a C# client app that sometimes needs to do thousands of specialized
file renames of files on a file server in the same domain. If the files
reside locally on the client machine, the renames take only a few seconds.
If the files reside on the file server, a set of 30,000 file renames may
take
a half hour to do.

I'm just using File.Move to do the rename. The renames are not moving the
files to a different folder, they are just changing the name of the file.

I'm assuming that network latency between each of the File.Move calls is
what is slowing the renaming down so much.

Is there a way to batch up all 30,000 File.Move commands to the server,
rather than sending them each one at a time so that I am not paying the
price
of the network latency between every single file rename? Or is there a
better way to speed this up? It needs to be almost as fast as doing it
locally on the client.

Mar 29 '06 #2

P: n/a
That wouldn't be easy to do because not all of the servers are Windows
machines, and I'm not certain how to write a service on the non-windows
platforms. Is there not some other way to speed this up?

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

No, you cannot batch them.

Can you install/run a remote program in the server?
You could send the execution to the remote service which will do it locally.

That would be the practical solution from my point of view.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Don Curtis" <Fa*******@online.nospam> wrote in message
news:8C**********************************@microsof t.com...
I have a C# client app that sometimes needs to do thousands of specialized
file renames of files on a file server in the same domain. If the files
reside locally on the client machine, the renames take only a few seconds.
If the files reside on the file server, a set of 30,000 file renames may
take
a half hour to do.

I'm just using File.Move to do the rename. The renames are not moving the
files to a different folder, they are just changing the name of the file.

I'm assuming that network latency between each of the File.Move calls is
what is slowing the renaming down so much.

Is there a way to batch up all 30,000 File.Move commands to the server,
rather than sending them each one at a time so that I am not paying the
price
of the network latency between every single file rename? Or is there a
better way to speed this up? It needs to be almost as fast as doing it
locally on the client.


Mar 29 '06 #3

P: n/a
Hi Don,

Another consideration is why you need change so many file names. Can you do
some file name mapping in your application? You just change the
relationship in the mapping hash and do not change real file name.

HTH,
Ryan

"Don Curtis" <Fa*******@online.nospam> дʼ
news:8C**********************************@microsof t.com...
I have a C# client app that sometimes needs to do thousands of specialized
file renames of files on a file server in the same domain. If the files
reside locally on the client machine, the renames take only a few seconds.
If the files reside on the file server, a set of 30,000 file renames may take a half hour to do.

I'm just using File.Move to do the rename. The renames are not moving the
files to a different folder, they are just changing the name of the file.

I'm assuming that network latency between each of the File.Move calls is
what is slowing the renaming down so much.

Is there a way to batch up all 30,000 File.Move commands to the server,
rather than sending them each one at a time so that I am not paying the price of the network latency between every single file rename? Or is there a
better way to speed this up? It needs to be almost as fast as doing it
locally on the client.

Mar 30 '06 #4

P: n/a
Hi,

I think for non-Windows platform, you may also try to write a remote
program.
Commonly the TCP/IP is implemented on almost all the platform, e.g. linux,
unix.
You can write a server application on the linux or unix, and listen to
certain port and the send the files you want to rename.
Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 30 '06 #5

P: n/a
Hi,
Renaming that many files remotely will be slow, no matter what method you
use.
Your best approach is to write a OS dependand service , you better do it in
C or C++ as it's almost 100% compatible across the different OSes. You will
have to use TCP to send the commands
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Don Curtis" <Fa*******@online.nospam> wrote in message
news:4A**********************************@microsof t.com...
That wouldn't be easy to do because not all of the servers are Windows
machines, and I'm not certain how to write a service on the non-windows
platforms. Is there not some other way to speed this up?

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

No, you cannot batch them.

Can you install/run a remote program in the server?
You could send the execution to the remote service which will do it
locally.

That would be the practical solution from my point of view.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Don Curtis" <Fa*******@online.nospam> wrote in message
news:8C**********************************@microsof t.com...
>I have a C# client app that sometimes needs to do thousands of
>specialized
> file renames of files on a file server in the same domain. If the
> files
> reside locally on the client machine, the renames take only a few
> seconds.
> If the files reside on the file server, a set of 30,000 file renames
> may
> take
> a half hour to do.
>
> I'm just using File.Move to do the rename. The renames are not moving
> the
> files to a different folder, they are just changing the name of the
> file.
>
> I'm assuming that network latency between each of the File.Move calls
> is
> what is slowing the renaming down so much.
>
> Is there a way to batch up all 30,000 File.Move commands to the server,
> rather than sending them each one at a time so that I am not paying the
> price
> of the network latency between every single file rename? Or is there a
> better way to speed this up? It needs to be almost as fast as doing it
> locally on the client.
>


Mar 30 '06 #6

P: n/a
Sounds like there's no magic bullet here like I was hoping. It's too bad
there's no way to batch up the commands rather than having to send them each
one at a time.

Thanks for your suggestions!

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,
Renaming that many files remotely will be slow, no matter what method you
use.
Your best approach is to write a OS dependand service , you better do it in
C or C++ as it's almost 100% compatible across the different OSes. You will
have to use TCP to send the commands
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Don Curtis" <Fa*******@online.nospam> wrote in message
news:4A**********************************@microsof t.com...
That wouldn't be easy to do because not all of the servers are Windows
machines, and I'm not certain how to write a service on the non-windows
platforms. Is there not some other way to speed this up?

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

No, you cannot batch them.

Can you install/run a remote program in the server?
You could send the execution to the remote service which will do it
locally.

That would be the practical solution from my point of view.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Don Curtis" <Fa*******@online.nospam> wrote in message
news:8C**********************************@microsof t.com...
>I have a C# client app that sometimes needs to do thousands of
>specialized
> file renames of files on a file server in the same domain. If the
> files
> reside locally on the client machine, the renames take only a few
> seconds.
> If the files reside on the file server, a set of 30,000 file renames
> may
> take
> a half hour to do.
>
> I'm just using File.Move to do the rename. The renames are not moving
> the
> files to a different folder, they are just changing the name of the
> file.
>
> I'm assuming that network latency between each of the File.Move calls
> is
> what is slowing the renaming down so much.
>
> Is there a way to batch up all 30,000 File.Move commands to the server,
> rather than sending them each one at a time so that I am not paying the
> price
> of the network latency between every single file rename? Or is there a
> better way to speed this up? It needs to be almost as fast as doing it
> locally on the client.
>


Mar 30 '06 #7

P: n/a
Interesting idea, but yes, I really do need to change the actual names of the
files.

"Ryan Liu" wrote:
Hi Don,

Another consideration is why you need change so many file names. Can you do
some file name mapping in your application? You just change the
relationship in the mapping hash and do not change real file name.

HTH,
Ryan

"Don Curtis" <Fa*******@online.nospam> дÈëÓʼþ
news:8C**********************************@microsof t.com...
I have a C# client app that sometimes needs to do thousands of specialized
file renames of files on a file server in the same domain. If the files
reside locally on the client machine, the renames take only a few seconds.
If the files reside on the file server, a set of 30,000 file renames may

take
a half hour to do.

I'm just using File.Move to do the rename. The renames are not moving the
files to a different folder, they are just changing the name of the file.

I'm assuming that network latency between each of the File.Move calls is
what is slowing the renaming down so much.

Is there a way to batch up all 30,000 File.Move commands to the server,
rather than sending them each one at a time so that I am not paying the

price
of the network latency between every single file rename? Or is there a
better way to speed this up? It needs to be almost as fast as doing it
locally on the client.


Mar 30 '06 #8

P: n/a
That service exists, it's called WMI.

Willy.

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:%2****************@tk2msftngp13.phx.gbl...
| Hi,
|
|
| Renaming that many files remotely will be slow, no matter what method you
| use.
| Your best approach is to write a OS dependand service , you better do it
in
| C or C++ as it's almost 100% compatible across the different OSes. You
will
| have to use TCP to send the commands
|
|
| --
| Ignacio Machin,
| ignacio.machin AT dot.state.fl.us
| Florida Department Of Transportation
|
|
| "Don Curtis" <Fa*******@online.nospam> wrote in message
| news:4A**********************************@microsof t.com...
| > That wouldn't be easy to do because not all of the servers are Windows
| > machines, and I'm not certain how to write a service on the non-windows
| > platforms. Is there not some other way to speed this up?
| >
| > "Ignacio Machin ( .NET/ C# MVP )" wrote:
| >
| >> Hi,
| >>
| >> No, you cannot batch them.
| >>
| >> Can you install/run a remote program in the server?
| >> You could send the execution to the remote service which will do it
| >> locally.
| >>
| >> That would be the practical solution from my point of view.
| >>
| >>
| >>
| >> --
| >> Ignacio Machin,
| >> ignacio.machin AT dot.state.fl.us
| >> Florida Department Of Transportation
| >>
| >> "Don Curtis" <Fa*******@online.nospam> wrote in message
| >> news:8C**********************************@microsof t.com...
| >> >I have a C# client app that sometimes needs to do thousands of
| >> >specialized
| >> > file renames of files on a file server in the same domain. If the
| >> > files
| >> > reside locally on the client machine, the renames take only a few
| >> > seconds.
| >> > If the files reside on the file server, a set of 30,000 file renames
| >> > may
| >> > take
| >> > a half hour to do.
| >> >
| >> > I'm just using File.Move to do the rename. The renames are not
moving
| >> > the
| >> > files to a different folder, they are just changing the name of the
| >> > file.
| >> >
| >> > I'm assuming that network latency between each of the File.Move calls
| >> > is
| >> > what is slowing the renaming down so much.
| >> >
| >> > Is there a way to batch up all 30,000 File.Move commands to the
server,
| >> > rather than sending them each one at a time so that I am not paying
the
| >> > price
| >> > of the network latency between every single file rename? Or is there
a
| >> > better way to speed this up? It needs to be almost as fast as doing
it
| >> > locally on the client.
| >> >
| >>
| >>
| >>
|
|
Mar 30 '06 #9

P: n/a
Hi,

"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:u0**************@TK2MSFTNGP10.phx.gbl...
That service exists, it's called WMI.


I find it difficult that WMI runs on a non Win OS , the OP said some of the
servers run another OS
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Mar 31 '06 #10

P: n/a

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:%2****************@tk2msftngp13.phx.gbl...
| Hi,
|
| "Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
| news:u0**************@TK2MSFTNGP10.phx.gbl...
| > That service exists, it's called WMI.
|
| I find it difficult that WMI runs on a non Win OS , the OP said some of
the
| servers run another OS
|
|
| --
| Ignacio Machin,
| ignacio.machin AT dot.state.fl.us
| Florida Department Of Transportation
|
|

This shouldn't be an issue, WBEM (MSFT's implementation is called WMI) is
available for most commercial OS like Linux, Netware, AIX, HP-UX, there are
even a number of open-source implementations available.

Willy.

Mar 31 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.