Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2006

Tip: Looking for answers? Try searching our database.

Fast Rename from client to server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Don Curtis - 29 Mar 2006 21:51 GMT
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.
Ignacio Machin ( .NET/ C# MVP ) - 29 Mar 2006 23:04 GMT
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.

Signature

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

>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
[quoted text clipped - 15 lines]
> better way to speed this up?  It needs to be almost as fast as doing it
> locally on the client.
Don Curtis - 29 Mar 2006 23:33 GMT
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?

> Hi,
>
[quoted text clipped - 24 lines]
> > better way to speed this up?  It needs to be almost as fast as doing it
> > locally on the client.
"Peter Huang" [MSFT] - 30 Mar 2006 02:39 GMT
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.
Ignacio Machin ( .NET/ C# MVP ) - 30 Mar 2006 14:57 GMT
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

Signature

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

> 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
[quoted text clipped - 36 lines]
>> > better way to speed this up?  It needs to be almost as fast as doing it
>> > locally on the client.
Don Curtis - 30 Mar 2006 16:36 GMT
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!

> Hi,
>
[quoted text clipped - 44 lines]
> >> > better way to speed this up?  It needs to be almost as fast as doing it
> >> > locally on the client.
Willy Denoyette [MVP] - 30 Mar 2006 20:56 GMT
That service exists, it's called WMI.

Willy.

| Hi,
|
[quoted text clipped - 44 lines]
| >> > better way to speed this up?  It needs to be almost as fast as doing it
| >> > locally on the client.
Ignacio Machin ( .NET/ C# MVP ) - 31 Mar 2006 14:55 GMT
Hi,

> 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

Signature

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

Willy Denoyette [MVP] - 31 Mar 2006 17:27 GMT
| Hi,
|
| > 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

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.
Ryan Liu - 30 Mar 2006 02:18 GMT
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

> 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
[quoted text clipped - 13 lines]
> better way to speed this up?  It needs to be almost as fast as doing it
> locally on the client.
Don Curtis - 30 Mar 2006 16:41 GMT
Interesting idea, but yes, I really do need to change the actual names of the
files.

> Hi Don,
>
[quoted text clipped - 24 lines]
> > better way to speed this up?  It needs to be almost as fast as doing it
> > locally on the client.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.