Jump to content

[Solved] File system permission differt between FileCopy & FileMove


taz742
 Share

Recommended Posts

I've a problem when using FileMove function with resulting file permission.

I've discover the problem because there is a lock overlayed icon the moved file:

Posted Image

Here an example script to reproduce my problem:

$file=@TempDir & "\filetest.txt"
$filehndl=FileOpen($file,2)
FileWriteLine($filehndl, "some text")
FileClose($filehndl)
FileCopy($file, @SystemDir & "\filetest_copy.txt",1)
FileMove($file, @SystemDir & "\filetest_move.txt",1)
Run('Explorer.exe "' & @SystemDir & '"')

The @SystemDir & "\filetest_copy.txt" has it permissions inherit from the @systemdir folder (which is normal)

but the @SystemDir & "\filetest_move.txt" has it own permissions (and this is problematic)

Posted Image Posted Image

So my questions are simple:

  • Is this normal or a bug?
  • If it's a bug how can I solve it?

PS: I'm using Win7x64 OS

Edited by taz742
Link to comment
Share on other sites

Hi,

this is a standard MS behaviour:

Copy file -> get security from folder

Move file on same partition -> keep security from file

Move file to other partition -> get security from folder

So you might copy file and then delete source.

;-))

Stefan

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...