rename() fails in C:/Documents and Settings/ directories

D

Dmitry

This may be more of a Windows issue, so if there's a better place to ask this, please advise.
But I figure that someone may have already dealt with this issue here. In fact, _I_ have dealt
with this issue some years ago, somehow, but for the life of me, I can't remember how I did
it!

I'm writing a script to automate the management of some program settings in C:\Documents
and Settings\xxx\Application Data\yyy. The script needs to manipulate files in that directory:
move out some files and move in others. Well, the problem is that I can move out anything I
want, but using rename() I can't move in anything. The error is reported as "No such file or
directory," which doesn't make sense.

It seems that the Documents and Settings directory tree is treated differently by the system.
All directories there are marked as read-only in Explorer, and the setting cannot be removed.
However, files within the directories are not necessarily read-only (the ones I am trying to
manipulate aren't). No other programs seem to have any trouble with these directories, but
Perl is defeated by them.

What can I do here?
 
G

Gunnar Hjalmarsson

Dmitry said:
I'm writing a script to automate the management of some program settings in C:\Documents
and Settings\xxx\Application Data\yyy. The script needs to manipulate files in that directory:
move out some files and move in others. Well, the problem is that I can move out anything I
want, but using rename() I can't move in anything. The error is reported as "No such file or
directory," which doesn't make sense.

What can I do here?

Post a short but complete Perl program that illustrates the issue you
are having.
 
D

Dmitry

Post a short but complete Perl program that illustrates the issue you
are having.

OK, disregard my OP: I tracked this down to a problem with Windows paths. Since that's a
completely different issue, another post coming up...
 

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

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top