Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS Error: File exists #284

Closed
vveckaln opened this issue Sep 1, 2015 · 8 comments
Closed

OS Error: File exists #284

vveckaln opened this issue Sep 1, 2015 · 8 comments

Comments

@vveckaln
Copy link

vveckaln commented Sep 1, 2015

Hello!
Here is another error that I sometimes receive:

xrdcp root://xrootd.unl.edu//store/mc/RunIISpring15DR74/TT_TuneZ2star_13TeV-powheg-pythia6-tauola/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v3/00000/22A50E5E-AF08-E511-8380-B8CA3A70A410.root /dev/null
[0B/0B][100%][==================================================][0B/s]
Run: [ERROR] OS Error: File exists

What could be the reason?
Cheers,
Viesturs

@ljanyst
Copy link
Contributor

ljanyst commented Sep 3, 2015

Well, the target file exists, so you need to use the -f flag to overwrite.

@abh3
Copy link
Member

abh3 commented Sep 3, 2015

Missing option to over-write an existing file. This is not a bug.

@abh3 abh3 closed this as completed Sep 3, 2015
@vveckaln
Copy link
Author

vveckaln commented Sep 3, 2015

Well, then I am surprised that the file already exists in the directory /dev/null
Viesturs

@abh3
Copy link
Member

abh3 commented Sep 3, 2015

This is a long standing quibble. Technically, /dev/null already exists and
you can't really place any files in it. You can just write to it. So, the
-f option is needed. The quibble is that xrdcp should recognize /dev/null
as a special file and not require the -f option.

Andy

On Thu, 3 Sep 2015, Viesturs Veckalns wrote:

Well, then I am surprised that the file already exists in the directory /dev/null
Viesturs


Reply to this email directly or view it on GitHub:
#284 (comment)

@ljanyst
Copy link
Contributor

ljanyst commented Sep 3, 2015

xrdcp warns you if you overwrite existing files. /dev/null is not a directory, it is a file that happens to represent a character device that will accept an infinite amount of data, the same as /dev/sda1 is a file representing a block device - the first partition of your SCSI disk. I don't see why /dev/null should be treated any different than other files.

@abh3
Copy link
Member

abh3 commented Sep 4, 2015

Hi Lukasz,

The only reason to treat /dev/null differently is because you really can't
remove it. It's a special system file and because it is special many
people think it should be treated as such. So, the -f flag is sort of
strange in this particular case.

Andy

On Thu, 3 Sep 2015, Lukasz Janyst wrote:

xrdcp warns you if you overwrite existing files. /dev/null is not a directory, it is a file that happens to represent a character device that will accept an infinite amount of data, the same as /dev/sda1 is a file representing a block device - the first partition of your SCSI disk. I don't see why /dev/null should be treated any different than other files.


Reply to this email directly or view it on GitHub:
#284 (comment)

@ljanyst
Copy link
Contributor

ljanyst commented Sep 4, 2015

OK, I see.

Just for the sake of the argument, you also cannot remove a normal file if you don't have write permissions to the directory it's in.

]==> mkdir test
]==> touch test/asdf
]==> chmod 500 test
]==> rm test/asdf 
rm: cannot remove ‘test/asdf’: Permission denied
]==> echo "asdf" > test/asdf
]==> cat test/asdf 
asdf

You'll obviously do whatever you want. I am just a consistency zealot :)

@abh3
Copy link
Member

abh3 commented Sep 4, 2015

Well, yes. We will likely keep it the way it is :-)

Andy

On Thu, 3 Sep 2015, Lukasz Janyst wrote:

OK, I see.

Just for the sake of the argument, you also cannot remove a normal file if you don't have write permissions to the directory it's in.

]==> mkdir test
]==> touch test/asdf
]==> chmod 500 test
]==> rm test/asdf
rm: cannot remove ÿÿtest/asdfÿÿ: Permission denied
]==> echo "asdf" > test/asdf
]==> cat test/asdf
asdf

You'll obviously do whatever you want. I am just a consistency zealot :)


Reply to this email directly or view it on GitHub:
#284 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants