반응형

파일이나 폴더를 삭제하려고 할 때 아래와 같이 'XXX에서 열려 있어 작업을 완료 할 수 없다'는 메세지가 나오는 경우가 있다.

파일이 사용 중이기 때문에 삭제할 수 없다.

물론 이런 경우 대부분 엑셀을 종료하면 간단히 해결 할 수 있지만 간혹 엑셀이 종료되었는데도 파일을 삭제할 수 없는 상황이 발생하기도 한다. 파일(폴더)의 핸들을 어디선가 다른 프로세스가 잡고 있기 때문이다.

 

간단히 비슷한 상황을 만들어 해결책을 알아보자.

 

삭제하고 싶은 폴더(Target)를 만들고 안에 파일 하나를 생성한다.

 

생성된 파일을 열어준다.

 

폴더(Target) 삭제를 시도한다. 폴더 내 파일이 사용 중이기 때문에 실패한다.

물론 우리는 메모장(notepad)이 파일을 잡고 있다는걸 알지만 여기서는 메모장의 상황은 모르는걸로 가정하자.

 

 

어떤 프로그램이 폴더(Target)를 사용 하는지 알아내기 위해 프로세스 익스플로러를 실행하고 Find - Find Handle or DLL...을 선택한다.

 

찾고 싶은 이름(target)을 입력하고 Search 버튼을 클릭한다.

'target' 문자열이 들어가는 이름의 핸들을 잡고 있는 프로세스를 모두 찾아준다. 위 예에선 우리가 삭제하고자 하는 'G:\Test\Target'을 notepad.exe 프로세스가 잡고 있는걸 확인 할 수 있다. 클릭한다.

 

notepad.exe 프로세스가 소유한 파일 핸들 중 'G:\Test\Target'이 있다.

어떤 프로세스가 핸들을 잡고 있는지 알아냈으므로 그 프로세스를 종료시키거나 다른 작업을 통해 핸들을 반환하도록 할 수 있다.

 

※ 참고

Process Explorer

 

반응형
Posted by J-sean
:
반응형

WMware 리눅스(우분투)와 윈도우 폴더를 공유해 보자.

 

가상머신의 세팅 옵션에서 Folder sharing을 enable하고 공유할 윈도우 폴더를 지정한다.

 

리눅스에서 공유에 사용할 디렉토리를 생성하고 아래 명령으로 마운팅 한다.

/usr/bin/vmhgfs-fuse .host:/ ~/shares -o subtype=vmhgfs-fuse,allow_other

위 그림과 같이 allow_other 옵션 때문에 에러가 발생한다면 아래 내용을 진행한다. (아니면 명령 앞에 sudo를 붙여준다)

 

/etc/fuse.conf 파일을 에디터로 오픈 한다.

 

user_allow_other 명령의 주석을 해제한다.

 

 

다시 마운팅 명령을 실행하면 문제 없이 마운팅 된다.

재부팅하면 다시 마운팅해야 한다.

 

※ 참고

Using Shared Folders

 

반응형
Posted by J-sean
:
반응형

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

Since 1992, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, Linux and many others.


This post describes how to create a public share on Samba in Fedora Linux.


Samba를 이용해 윈도우에서도 접속 가능한 리눅스 공유 폴더를 간단히 만들 수 있다. 사용자 이름이나 암호 없이 접속 가능한 간단한 공유 폴더를 만들어 보자.


Download and install Samba package.


Edit '/etc/samba/smb.conf'


Add the following in [global].

netbios name = sean

map to guest = Bad User


Make [share] at the end and add the following in it.

path = /share

public = yes

writable = yes


Run 'testparm' and check 'smb.conf'.


Move to the root directory and make a directory you want to share.

The name of the sharing directory has to be the same as the name you assigned to 'path' in 'smb.conf' [share].


※ 'share' has read and execute permissions only for 'other'. So if you access it as an 'other', you can't write to it unless you give write permission to 'other'. (chmod 777 share)



Add Samba service to the firewall and reload it.


Start and enable Samba. To start services automatically at boot, you must enable them.


Run 'File Explorer' in Windows and access to the sharing directory in Linux by its IP address.


You can also access the directory by the name you assigned to 'netbios name' in 'smb.conf' [global]


반응형
Posted by J-sean
: