file-ownership

Docker compose file ownership

你。 提交于 2021-02-09 11:58:08
问题 I created Django project with Docker Compose: Dockerfile FROM python:2.7 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD . /code/ RUN pip install -r requirements.txt WORKDIR /code/example ENTRYPOINT ["python", "manage.py"] docker-compose.yml postgres: image: postgres ports: - '5432:5432' django-project: build: . command: runserver 0.0.0.0:8000 volumes: - .:/code ports: - '8000:8000' links: - postgres It work nice. But all new files which create through container 'django-project' have

Keeping fileowner and permissions after copying file in C

懵懂的女人 提交于 2020-02-16 08:14:30
问题 here is my problem: In C, I create the copy of a file (with some changes) This is done trivially via fopen(), getchar and putchar. Copying the file is fine and the outputfile itself is what I want it to be. My problem is: I assume that I will use this program often as sudo and then the resulting file has both another owner (root) as well as different permissions (execute rights are gone). My question is: How can I copy the owner and permissions of the original file and then write them into

Keeping fileowner and permissions after copying file in C

喜欢而已 提交于 2020-02-16 08:14:08
问题 here is my problem: In C, I create the copy of a file (with some changes) This is done trivially via fopen(), getchar and putchar. Copying the file is fine and the outputfile itself is what I want it to be. My problem is: I assume that I will use this program often as sudo and then the resulting file has both another owner (root) as well as different permissions (execute rights are gone). My question is: How can I copy the owner and permissions of the original file and then write them into

Why docker-compose creates directories/files with user:group 999:999?

自闭症网瘾萝莉.ら 提交于 2020-01-21 11:12:25
问题 I used docker-compose up with the following docker-compose.yml version: '3.5' services: mysql-server: image: mysql:5.7 environment: - MYSQL_ROOT_PASSWORD=root_pwd volumes: - ./var/lib/mysql:/var/lib/mysql:rw The directory ./var/lib/mysql does not exist initially. After running docker-compose up .. ls -al ./var/lib/mysql command shows all the files with user:group 999:999 . I cannot find user or group called 999 in my system. Why docker-compose chooses to create files with a non-existing uid

How to get file's owner name in Linux using C++?

懵懂的女人 提交于 2020-01-20 18:59:25
问题 How can I get get the owner name and group name of a file on a Linux filesystem using C++? The stat() call only gives me owner ID and group ID but not the actual name. -rw-r--r--. 1 john devl 3052 Sep 6 18:10 blah.txt How can I get 'john' and 'devl' programmatically? 回答1: Use getpwuid() and getgrgid(). #include <pwd.h> #include <grp.h> #include <sys/stat.h> struct stat info; stat(filename, &info); // Error check omitted struct passwd *pw = getpwuid(info.st_uid); struct group *gr = getgrgid

How to get file's owner name in Linux using C++?

故事扮演 提交于 2020-01-20 18:58:08
问题 How can I get get the owner name and group name of a file on a Linux filesystem using C++? The stat() call only gives me owner ID and group ID but not the actual name. -rw-r--r--. 1 john devl 3052 Sep 6 18:10 blah.txt How can I get 'john' and 'devl' programmatically? 回答1: Use getpwuid() and getgrgid(). #include <pwd.h> #include <grp.h> #include <sys/stat.h> struct stat info; stat(filename, &info); // Error check omitted struct passwd *pw = getpwuid(info.st_uid); struct group *gr = getgrgid

Change linux user default ownership on file creation? [closed]

孤人 提交于 2020-01-04 14:30:04
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Seems like something which should be easy to find but Googling brings up lots of unrelated tasks. I have a deploy scipt which runs under the user "deploy" but my web server runs as "nginx" I want the web server to be able to write to the deployed files. Ive added nginx to the deploy user group and I believe I

Reading file and directory owner using PHP on the Windows

我是研究僧i 提交于 2019-12-23 06:08:28
问题 I have an intranet project based on the PHP and xampp server on the Windows. That intranet project have database with table where I store scanned disc drive informations of files and folders. I using simple windows command dir "$directory_path" /Q /T:C to get informations. After that I use regex to match and parse that info to separate date, time, permission and dir name like on this example: EXAMPLE REGEX FOR DIRECTORY PARSING It's similar like this example: Get file owner in Windows using

Cocoa - How to connect view's delegate to file's owner in storyboard mode?

自作多情 提交于 2019-12-21 07:19:16
问题 When I use an .xib, I connect a view's delegate to the File's Owner via interface builder, then go into the view controller's .h file and set it as the delegate to complete the connection via . However in storyboard mode, there is no file's owner object. I am using an engine called NinevehGL, which simplifies the process of rendering models with openGL. This engine requires that I create a view, set it's class to NGLView, connect it's delegate to the file's owner object, and add to the header

Nobody owner (99 99) in FTP caused by php functions?

痴心易碎 提交于 2019-12-10 11:13:49
问题 I have a script (Joomla) that creates files and directories on the server. The problem is that it creates them under owner 99 99 (nobody) and after I can't delete or modify them by FTP without the help of the server admin. I think that is move_uploaded_file function of php. Is there any solution of this problem by the WHM or by the server admin? Can I modify the default owner in ftp? 回答1: What happens is the HTTP server is ran by a user called "nobody", and your FTP user is another one. When