473,466 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

renaming an open file in nt like unix?

Hi. I'm writing an archival system which I'd like to be portable
to Windows.

The system relies on the property of Unix which allows a
process to keep a file open even if another process renames
it while it is open. Neither process sees any anomaly or
error.

Do the NT file systems support this feature (which I think is
standard for POSIX systems)?

Inquiring minds want to know. -- Aaron Watters

===
an apple every 8 hours
will keep 3 doctors away. -- kliban

Jul 13 '07 #1
2 1541
aa***********@gmail.com schrieb:
Hi. I'm writing an archival system which I'd like to be portable
to Windows.

The system relies on the property of Unix which allows a
process to keep a file open even if another process renames
it while it is open. Neither process sees any anomaly or
error.

Do the NT file systems support this feature (which I think is
standard for POSIX systems)?
Yes, you can do that. We implemented something like this to replace
dlls there are currently in use - rename the currently open file, create a new one
with the old name (newly started processes will use the new one then),
and delete the renamed one at the next possible occasion (usually at
the next reboot). I'm not so sure on which NT versions it works this
way, at least in w2000 and newer.

Thomas

Jul 13 '07 #2
Thomas Heller wrote:
aa***********@gmail.com schrieb:
>Hi. I'm writing an archival system which I'd like to be portable
to Windows.

The system relies on the property of Unix which allows a
process to keep a file open even if another process renames
it while it is open. Neither process sees any anomaly or
error.

Do the NT file systems support this feature (which I think is
standard for POSIX systems)?

Yes, you can do that. We implemented something like this to replace
dlls there are currently in use - rename the currently open file, create a new one
with the old name (newly started processes will use the new one then),
and delete the renamed one at the next possible occasion (usually at
the next reboot). I'm not so sure on which NT versions it works this
way, at least in w2000 and newer.

Thomas
You do have to be careful though, because sometimes Windows refuses to
let you rename a file because it's in use.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

Jul 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: dudufigueiredo | last post by:
I have one folder containing mp3 files, the folder is: C:\My Shared Folder\Rubber Soul And the files are: 01 drive my car.mp3 02 norwegian wood.mp3 03 you won't see me.mp3 04 nowhere man.mp3...
1
by: Don Leverton | last post by:
Hi Folks, I have been given a CD with approx 130 .xls files (bean-counters!) that I would like to import and merge to ONE table (tblTradeshow). The XL files are *similarly*, but not...
8
by: BillCo | last post by:
I'm updating a legacy app with table naming that makes baby jesus cry. It's a bit of a spider web though... no telling when and where the tables will be called by name. So I wrote this for renaming...
14
by: Rochester | last post by:
Hi, I just found out that the general open file mechanism doesn't work for named pipes (fifo). Say I wrote something like this and it simply hangs python: #!/usr/bin/python import os
5
by: bulldog8 | last post by:
I've read numerous posts and have tried multiple approaches that I found, but just cannot get a file renamed. I am using VB.Net 2002 ... Here is what I have tried: 1) Code common to all...
5
by: barnetod | last post by:
I am trying to open a text file designated by the user. Then I want to change all lower case values to capital letters. Then write file. I am stuck and can not change the characters or am...
2
by: =?Utf-8?B?UHVjY2E=?= | last post by:
I need to retrieve and open a file stored on a Unix server on a network and opens the file as a delimited text file. I'm using VS2005, .net 2.0 and C#. What's the best way to do this and if...
4
by: pablocruise77 | last post by:
We have two Perl script that use the open command to read an encrypted file. We just changed from gzip to gpg. One script works fine. The other is called from the web and fails on the open. ...
7
by: pal | last post by:
Hi, How to use the open() ( mean syntax ) to open a file and to append the data every time at the end of the file. My Problem is, I created a file and written some data into it, and...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.