Does storing temporarily a non-encrypted file containing some PANs violate pci requirements? (for example because it is being processed by an application, or to open it on a file editor)
Yes, it's a violation of PCI-DSS Requirements, specifically requirement 3.4:
Render PAN unreadable anywhere it is stored (including on portable digital media, backup media, and in logs) by using any of the following approaches:
- One-way hashes based on strong cryptography (hash must be of the entire PAN)
- Truncation (hashing cannot be used to replace the truncated segment of PAN)
- Index tokens and pads (pads must be securely stored)
- Strong cryptography with associated key-management processes and procedures
Yes, you can't write out unencrypted PAN. If someone could force a crash while that file is being worked on, it would leave it sitting around on the server for anyone to access and the file could potentially be read by other processes.
There is no such thing as a "temporary" file. There are only permanent files you intend to get rid of soon.
Also, why do you need to open it in a file editor to begin with? That sounds like it is asking for a whole set of PCI problems all by itself.