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

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

am 30.03.2008 18:26:09 von 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?

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

am 30.03.2008 18:31:59 von Gunnar Hjalmarsson

Dmitry wrote:
> 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.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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

am 30.03.2008 20:57:30 von Dmitry

Gunnar Hjalmarsson wrote in
news:659to0F2eoebqU1@mid.individual.net:

> Dmitry wrote:
>> 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.
>

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...